Skip to content

Commit 807470f

Browse files
committed
Add testing for NaT on datetime values
1 parent 49e67c7 commit 807470f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_properties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ def test_array_metadata_meets_spec(meta: ArrayV2Metadata | ArrayV3Metadata) -> N
287287
# version-agnostic validations
288288
if meta.dtype.kind == "f":
289289
assert serialized_float_is_valid(asdict_dict["fill_value"])
290-
if meta.dtype.kind == "c":
290+
elif meta.dtype.kind == "c":
291291
# fill_value should be a two-element array [real, imag].
292292
assert serialized_float_is_valid(asdict_dict["fill_value"].real)
293293
assert serialized_float_is_valid(asdict_dict["fill_value"].imag)
294+
elif meta.dtype.kind == "M" and np.isnat(meta.fill_value):
295+
assert asdict_dict["fill_value"] == "NaT"

0 commit comments

Comments
 (0)