Skip to content

Commit

Permalink
fixed type hint (tests would have caught it)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed Nov 20, 2024
1 parent 0dd0e73 commit 550c237
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/awkward/contents/bitmaskedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> BitMaskedFo
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> BitMaskedForm:
def _form_with_key_path(self, path: (str | int | None)) -> BitMaskedForm:
return self.form_cls(
self._mask.form,
self._content._form_with_key_path((*path, None)),
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/bytemaskedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> ByteMaskedF
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> ByteMaskedForm:
def _form_with_key_path(self, path: (str | int | None)) -> ByteMaskedForm:
return self.form_cls(
self._mask.form,
self._content._form_with_key_path((*path, None)),
Expand Down
4 changes: 2 additions & 2 deletions src/awkward/contents/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ def _form_with_key(
) -> Form:
raise NotImplementedError

def form_with_key_path(self, root: (str | None) = ()) -> Form:
def form_with_key_path(self, root: (str | int | None) = ()) -> Form:
return self._form_with_key_path(root)

def _form_with_key_path(self, path: (str | None)) -> Form:
def _form_with_key_path(self, path: (str | int | None)) -> Form:
raise NotImplementedError

@property
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/emptyarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def simplified(cls, *, parameters=None, backend=None):
def _form_with_key(self, getkey: Callable[[Content], str | None]) -> EmptyForm:
return self.form_cls(form_key=getkey(self))

def _form_with_key_path(self, path: (str | None)) -> EmptyForm:
def _form_with_key_path(self, path: (str | int | None)) -> EmptyForm:
return self.form_cls(form_key=repr(path))

def _to_buffers(
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/indexedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> IndexedForm
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> IndexedForm:
def _form_with_key_path(self, path: (str | int | None)) -> IndexedForm:
return self.form_cls(
self._index.form,
self._content._form_with_key_path((*path, None)),
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 @@ -202,7 +202,7 @@ def _form_with_key(
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> IndexedOptionForm:
def _form_with_key_path(self, path: (str | int | None)) -> IndexedOptionForm:
return self.form_cls(
self._index.form,
self._content._form_with_key_path((*path, None)),
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/listarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> ListForm:
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> ListForm:
def _form_with_key_path(self, path: (str | int | None)) -> ListForm:
return self.form_cls(
self._starts.form,
self._stops.form,
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/listoffsetarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> ListOffsetF
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> ListOffsetForm:
def _form_with_key_path(self, path: (str | int | None)) -> ListOffsetForm:
return self.form_cls(
self._offsets.form,
self._content._form_with_key_path((*path, None)),
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/numpyarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> NumpyForm:
form_key=getkey(self),
)

def _form_with_key_path(self, path: (str | None)) -> NumpyForm:
def _form_with_key_path(self, path: (str | int | None)) -> NumpyForm:
return self.form_cls(
ak.types.numpytype.dtype_to_primitive(self._data.dtype),
self.inner_shape,
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/recordarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> RecordForm:
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> RecordForm:
def _form_with_key_path(self, path: (str | int | None)) -> RecordForm:
if self._fields is None:
contents = [
x._form_with_key_path((*path, i)) for i, x in enumerate(self._contents)
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/regulararray.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> RegularForm
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> RegularForm:
def _form_with_key_path(self, path: (str | int | None)) -> RegularForm:
return self.form_cls(
self._content._form_with_key_path((*path, None)),
self._size,
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/unionarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> UnionForm:
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> UnionForm:
def _form_with_key_path(self, path: (str | int | None)) -> UnionForm:
return self.form_cls(
self._tags.form,
self._index.form,
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/contents/unmaskedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _form_with_key(self, getkey: Callable[[Content], str | None]) -> UnmaskedFor
form_key=form_key,
)

def _form_with_key_path(self, path: (str | None)) -> UnmaskedForm:
def _form_with_key_path(self, path: (str | int | None)) -> UnmaskedForm:
return self.form_cls(
self._content._form_with_key_path((*path, None)),
parameters=self._parameters,
Expand Down

0 comments on commit 550c237

Please sign in to comment.