Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
brokkoli71 committed Feb 19, 2025
1 parent 56d1dea commit 276bdf3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/zarr/core/buffer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,10 @@ def as_scalar(self) -> ScalarType:

if np.issubdtype(self.dtype, np.datetime64):
unit: str = np.datetime_data(self.dtype)[0] # Extract the unit (e.g., 'Y', 'D', etc.)
value: ScalarType = np.datetime64(item, unit)
return np.datetime64(item, unit)
else:
value: ScalarType = self.dtype.type(item) # Regular conversion for non-datetime types
return self.dtype.type(item) # Regular conversion for non-datetime types

return value

@property
def dtype(self) -> np.dtype[Any]:
Expand Down

0 comments on commit 276bdf3

Please sign in to comment.