Skip to content

Commit

Permalink
Add testing for NaT on datetime values
Browse files Browse the repository at this point in the history
  • Loading branch information
moradology committed Feb 19, 2025
1 parent 49e67c7 commit 807470f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ def test_array_metadata_meets_spec(meta: ArrayV2Metadata | ArrayV3Metadata) -> N
# version-agnostic validations
if meta.dtype.kind == "f":
assert serialized_float_is_valid(asdict_dict["fill_value"])
if meta.dtype.kind == "c":
elif meta.dtype.kind == "c":
# fill_value should be a two-element array [real, imag].
assert serialized_float_is_valid(asdict_dict["fill_value"].real)
assert serialized_float_is_valid(asdict_dict["fill_value"].imag)
elif meta.dtype.kind == "M" and np.isnat(meta.fill_value):
assert asdict_dict["fill_value"] == "NaT"

0 comments on commit 807470f

Please sign in to comment.