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

llnl / dftracer-utils / 29185833209

12 Jul 2026 08:25AM UTC coverage: 51.235% (-1.5%) from 52.754%
29185833209

Pull #96

github

web-flow
Merge 0b9f07110 into 056c79287
Pull Request #96: fix: consolidate stale-index rebuilds across consumers and fix multi-run breaks

33724 of 84486 branches covered (39.92%)

Branch coverage included in aggregate %.

140 of 147 new or added lines in 15 files covered. (95.24%)

5188 existing lines in 197 files now uncovered.

34547 of 48765 relevant lines covered (70.84%)

10791.85 hits per line

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

66.67
/src/dftracer/utils/python/arrow_helpers.cpp
1
#include <dftracer/utils/core/common/config.h>
2
#ifdef DFTRACER_UTILS_ENABLE_ARROW
3

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

9
namespace dftracer::utils::python {
10

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

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

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

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

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

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

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

51
PyObject *wrap_arrow_stream_table(PyObject *stream_obj) {
13✔
52
    // dftracer.utils.arrow.ArrowTable accepts either a batch list or a stream
53
    // object, so wrapping is identical for both.
54
    return wrap_arrow_table(stream_obj);
13✔
55
}
56

57
PyObject *arrow_result_to_table(ArrowExportResult result) {
6✔
58
    PyObject *capsule = wrap_arrow_result(std::move(result));
6!
59
    if (!capsule) return NULL;
6!
60

61
    PyObject *list = PyList_New(1);
6✔
62
    if (!list) {
6!
UNCOV
63
        Py_DECREF(capsule);
×
64
        return NULL;
×
65
    }
66
    PyList_SET_ITEM(list, 0, capsule);  // steals ref
6✔
67

68
    return wrap_arrow_table(list);
6✔
69
}
6✔
70

71
}  // namespace dftracer::utils::python
72

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

© 2026 Coveralls, Inc