• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 23531027933

25 Mar 2026 08:05AM UTC coverage: 48.592% (-1.5%) from 50.098%
23531027933

Pull #57

github

web-flow
Merge d1070e289 into 38f9f3616
Pull Request #57: feat(comparator): add pairwise traces comparator

18900 of 49456 branches covered (38.22%)

Branch coverage included in aggregate %.

1604 of 1954 new or added lines in 25 files covered. (82.09%)

3407 existing lines in 135 files now uncovered.

18487 of 27485 relevant lines covered (67.26%)

240991.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.45
/src/dftracer/utils/python/arrow_helpers.cpp
1
#ifdef DFTRACER_UTILS_ENABLE_ARROW
2

3
#define PY_SSIZE_T_CLEAN
4
#include <Python.h>
5
#include <dftracer/utils/python/arrow_helpers.h>
6
#include <dftracer/utils/python/trace_reader_iterator.h>
7

8
namespace dftracer::utils::python {
9

10
PyObject *wrap_arrow_result(ArrowExportResult result) {
14✔
11
    if (!result.valid()) {
14!
12
        PyErr_SetString(PyExc_RuntimeError,
×
13
                        "Cannot wrap invalid ArrowExportResult");
14
        return NULL;
×
15
    }
16

17
    auto *cap = (ArrowBatchCapsuleObject *)ArrowBatchCapsuleType.tp_alloc(
14✔
18
        &ArrowBatchCapsuleType, 0);
19
    if (!cap) return NULL;
14!
20

21
    cap->result = new ArrowExportResult(std::move(result));
14!
22
    return (PyObject *)cap;
14✔
23
}
14✔
24

25
PyObject *wrap_arrow_table(PyObject *batch_list) {
19✔
26
    if (!batch_list) {
19!
27
        PyErr_SetString(PyExc_RuntimeError, "batch_list is NULL");
×
28
        return NULL;
×
29
    }
30

31
    PyObject *mod = PyImport_ImportModule("dftracer.utils.arrow");
19✔
32
    if (!mod) {
19!
UNCOV
33
        Py_DECREF(batch_list);
×
34
        return NULL;
×
35
    }
36

37
    PyObject *cls = PyObject_GetAttrString(mod, "ArrowTable");
19✔
38
    Py_DECREF(mod);
19✔
39
    if (!cls) {
19!
UNCOV
40
        Py_DECREF(batch_list);
×
41
        return NULL;
×
42
    }
43

44
    PyObject *table = PyObject_CallFunctionObjArgs(cls, batch_list, NULL);
19✔
45
    Py_DECREF(cls);
19✔
46
    Py_DECREF(batch_list);
19✔
47
    return table;
19✔
48
}
19✔
49

50
PyObject *arrow_result_to_table(ArrowExportResult result) {
6✔
51
    PyObject *capsule = wrap_arrow_result(std::move(result));
6!
52
    if (!capsule) return NULL;
6!
53

54
    PyObject *list = PyList_New(1);
6✔
55
    if (!list) {
6!
UNCOV
56
        Py_DECREF(capsule);
×
57
        return NULL;
×
58
    }
59
    PyList_SET_ITEM(list, 0, capsule);  // steals ref
6✔
60

61
    return wrap_arrow_table(list);
6✔
62
}
6✔
63

64
}  // namespace dftracer::utils::python
65

66
#endif  // DFTRACER_UTILS_ENABLE_ARROW
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc