Skip to content

Commit

Permalink
feat: make default buffer key nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Oct 3, 2023
1 parent 0f8b5d7 commit 211b5ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/dask_awkward/lib/io/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def mock(self) -> AwkwardArray:
def prepare_for_projection(
self,
) -> tuple[AwkwardArray, TypeTracerReport, FormStructure]:
form = form_with_unique_keys(self.form, "<root>")
form = form_with_unique_keys(self.form, "@")

# Build typetracer and associated report object
(meta, report) = ak.typetracer.typetracer_with_report(
Expand Down
2 changes: 1 addition & 1 deletion src/dask_awkward/lib/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def mock(self) -> AwkwardArray:
def prepare_for_projection(
self,
) -> tuple[AwkwardArray, TypeTracerReport, FormStructure]:
form = form_with_unique_keys(self.form, "<root>")
form = form_with_unique_keys(self.form, "@")

# Build typetracer and associated report object
(meta, report) = ak.typetracer.typetracer_with_report(
Expand Down
18 changes: 9 additions & 9 deletions tests/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def test_necessary_buffers(
assert v == (
frozenset(
{
"<root>.points-offsets",
"<root>.points.content.y-data",
"<root>.points.content.x-data",
"@.points-offsets",
"@.points.content.y-data",
"@.points.content.x-data",
}
),
frozenset(),
Expand All @@ -29,7 +29,7 @@ def test_necessary_buffers(
)
for k, v in dak.report_necessary_buffers(w).items():
assert v == (
frozenset({"<root>.points-offsets", "<root>.points.content.x-data"}),
frozenset({"@.points-offsets", "@.points.content.x-data"}),
frozenset(),
)

Expand All @@ -38,9 +38,9 @@ def test_necessary_buffers(
assert v == (
frozenset(
{
"<root>.points-offsets",
"<root>.points.content.x-data",
"<root>.points.content.y-data",
"@.points-offsets",
"@.points.content.x-data",
"@.points.content.y-data",
}
),
frozenset(),
Expand All @@ -49,8 +49,8 @@ def test_necessary_buffers(
z = dak.zeros_like(daa.points.x)
for k, v in dak.report_necessary_buffers(z).items():
assert v == (
frozenset({"<root>.points-offsets"}),
frozenset({"<root>.points.content.x-data"}),
frozenset({"@.points-offsets"}),
frozenset({"@.points.content.x-data"}),
)


Expand Down

0 comments on commit 211b5ed

Please sign in to comment.