Skip to content

Commit 2dc3bed

Browse files
committed
TST: HDF5 roundtrip of tz-aware series (empty & non-empty)
1 parent ca27cca commit 2dc3bed

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
@@ -296,6 +296,24 @@ def test_timezones_fixed(setup_path):
296296
tm.assert_frame_equal(result, df)
297297

298298

299+
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
300+
def test_timezones_fixed_format_series_nonempty(setup_path, dtype):
301+
with ensure_clean_store(setup_path) as store:
302+
s = Series([0], dtype=dtype)
303+
store["s"] = s
304+
result = store["s"]
305+
tm.assert_series_equal(result, s)
306+
307+
308+
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
309+
def test_timezones_fixed_format_series_empty(setup_path, dtype):
310+
with ensure_clean_store(setup_path) as store:
311+
s = Series(dtype=dtype)
312+
store["s"] = s
313+
result = store["s"]
314+
tm.assert_series_equal(result, s)
315+
316+
299317
def test_fixed_offset_tz(setup_path):
300318
rng = date_range("1/1/2000 00:00:00-07:00", "1/30/2000 00:00:00-07:00")
301319
frame = DataFrame(np.random.randn(len(rng), 4), index=rng)

0 commit comments

Comments
 (0)