Skip to content

Commit 9ceb1a8

Browse files
committed
TST: HDF5 roundtrip of tz-aware series (empty & non-empty)
1 parent 7eb1063 commit 9ceb1a8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pandas/tests/io/pytables/test_timezones.py

+18
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,24 @@ def test_timezones_fixed_format_frame_empty(setup_path, dtype):
306306
tm.assert_frame_equal(result, df)
307307

308308

309+
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
310+
def test_timezones_fixed_format_series_nonempty(setup_path, dtype):
311+
with ensure_clean_store(setup_path) as store:
312+
s = Series([0], dtype=dtype)
313+
store["s"] = s
314+
result = store["s"]
315+
tm.assert_series_equal(result, s)
316+
317+
318+
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
319+
def test_timezones_fixed_format_series_empty(setup_path, dtype):
320+
with ensure_clean_store(setup_path) as store:
321+
s = Series(dtype=dtype)
322+
store["s"] = s
323+
result = store["s"]
324+
tm.assert_series_equal(result, s)
325+
326+
309327
def test_fixed_offset_tz(setup_path):
310328
rng = date_range("1/1/2000 00:00:00-07:00", "1/30/2000 00:00:00-07:00")
311329
frame = DataFrame(np.random.randn(len(rng), 4), index=rng)

0 commit comments

Comments
 (0)