diff --git a/src/awkward/contents/indexedarray.py b/src/awkward/contents/indexedarray.py index 6ddcf3417c..6ab0e70cd1 100644 --- a/src/awkward/contents/indexedarray.py +++ b/src/awkward/contents/indexedarray.py @@ -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() diff --git a/src/awkward/contents/indexedoptionarray.py b/src/awkward/contents/indexedoptionarray.py index dc67d1ca3f..2fb939f014 100644 --- a/src/awkward/contents/indexedoptionarray.py +++ b/src/awkward/contents/indexedoptionarray.py @@ -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() diff --git a/src/awkward/contents/listarray.py b/src/awkward/contents/listarray.py index 9de9c65814..015379d5bf 100644 --- a/src/awkward/contents/listarray.py +++ b/src/awkward/contents/listarray.py @@ -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): diff --git a/src/awkward/contents/listoffsetarray.py b/src/awkward/contents/listoffsetarray.py index f261717b87..9f0eaaa418 100644 --- a/src/awkward/contents/listoffsetarray.py +++ b/src/awkward/contents/listoffsetarray.py @@ -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