Skip to content

Commit

Permalink
fix _getitem_at_placeholder (#3368)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfackeldey authored Jan 16, 2025
1 parent c075948 commit f35dc08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/awkward/contents/indexedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def _getitem_nothing(self):
return self._content._getitem_range(0, 0)

def _is_getitem_at_placeholder(self) -> bool:
if isinstance(self._index, PlaceholderArray):
if isinstance(self._index.data, PlaceholderArray):
return True
return self._content._is_getitem_at_placeholder()

Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/indexedoptionarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def _getitem_nothing(self):
return self._content._getitem_range(0, 0)

def _is_getitem_at_placeholder(self) -> bool:
if isinstance(self._index, PlaceholderArray):
if isinstance(self._index.data, PlaceholderArray):
return True
return self._content._is_getitem_at_placeholder()

Expand Down
4 changes: 2 additions & 2 deletions src/awkward/contents/listarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ def _getitem_nothing(self):
return self._content._getitem_range(0, 0)

def _is_getitem_at_placeholder(self) -> bool:
return isinstance(self._starts, PlaceholderArray) or isinstance(
self._stops, PlaceholderArray
return isinstance(self._starts.data, PlaceholderArray) or isinstance(
self._stops.data, PlaceholderArray
)

def _getitem_at(self, where: IndexType):
Expand Down
5 changes: 4 additions & 1 deletion src/awkward/contents/listoffsetarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ def _getitem_nothing(self):
return self._content._getitem_range(0, 0)

def _is_getitem_at_placeholder(self) -> bool:
return isinstance(self._offsets, PlaceholderArray)
return (
isinstance(self._offsets.data, PlaceholderArray)
or self._content._is_getitem_at_placeholder()
)

def _getitem_at(self, where: IndexType):
# Wrap `where` by length
Expand Down

0 comments on commit f35dc08

Please sign in to comment.