Skip to content

Commit

Permalink
refactor: clarify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Sep 14, 2023
1 parent 5ac5903 commit 1e54a19
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dask_awkward/lib/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,11 @@ def _prune_wildcards(columns: list[str], meta: AwkwardArray) -> list[str]:
good_columns.append(column)

for column in wildcard_columns:
definite_column = column[:-2]
# each time we meet a wildcard column we need to start back
# with the original meta array.
imeta = meta
reverse_column_parts = [*column.split(".")[:-1]]
reverse_column_parts = [*definite_column.split(".")]
reverse_column_parts.reverse()

while reverse_column_parts:
Expand All @@ -506,8 +507,6 @@ def _prune_wildcards(columns: list[str], meta: AwkwardArray) -> list[str]:
# need this if statement.
if part:
imeta = imeta[part]

definite_column = column[:-2]
# The given wildcard column contains no sub-columns, so load
# the column itself
if not imeta.fields:
Expand Down

0 comments on commit 1e54a19

Please sign in to comment.