Skip to content

Commit 4d63dc3

Browse files
committed
Build test for type tracer build and needed branches
1 parent 99f75c8 commit 4d63dc3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_typetracer.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import awkward as ak
2+
import pytest
3+
4+
from servicex_analysis_utils import read_buffers
5+
6+
7+
def test_simple_record_typetracer():
8+
arr = ak.Array([{"x": [1, 2, 3], "y": [4, 5]}])
9+
10+
form = arr.layout.form
11+
tracer, report = read_buffers.build_typetracer(form)
12+
13+
# “Touch” one of the two fields
14+
_ = tracer["x"] + 0
15+
16+
# Collect the branches and assert exactly one branch is needed (x)
17+
touched_branches = read_buffers.necessary_branches(report)
18+
assert set(touched_branches) == {"x"}

0 commit comments

Comments
 (0)