Skip to content

Commit

Permalink
fix boolean condition
Browse files Browse the repository at this point in the history
  • Loading branch information
pfackeldey committed Nov 13, 2024
1 parent 5661155 commit 6a89326
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/awkward/_namedaxis.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def _get_named_axis(ctx: tp.Any, allow_any: bool = False) -> AxisMapping:
from awkward._layout import HighLevelContext
from awkward.highlevel import Array, Record

if hasattr(ctx, "attrs") and isinstance(ctx, (HighLevelContext, Array, Record)):
if hasattr(ctx, "attrs") and (
isinstance(ctx, (HighLevelContext, Array, Record)) or allow_any
):
return _get_named_axis(ctx.attrs, allow_any=True)
elif allow_any and isinstance(ctx, tp.Mapping) and NAMED_AXIS_KEY in ctx:
return dict(ctx[NAMED_AXIS_KEY])
Expand Down

0 comments on commit 6a89326

Please sign in to comment.