Skip to content

Commit 9886aa8

Browse files
committed
TST: HDF5 roundtrip of empty tz-aware dataframe
1 parent 52b45e3 commit 9886aa8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pandas/tests/io/pytables/test_timezones.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def test_tseries_select_index_column(setup_path):
243243
assert rng.tz == result.dt.tz
244244

245245

246-
def test_timezones_fixed(setup_path):
246+
def test_timezones_fixed_format_frame_non_empty(setup_path):
247247
with ensure_clean_store(setup_path) as store:
248248

249249
# index
@@ -271,6 +271,16 @@ def test_timezones_fixed(setup_path):
271271
tm.assert_frame_equal(result, df)
272272

273273

274+
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
275+
def test_timezones_fixed_format_frame_empty(setup_path, dtype):
276+
with ensure_clean_store(setup_path) as store:
277+
s = Series(dtype=dtype)
278+
df = DataFrame({"A": s})
279+
store["df"] = df
280+
result = store["df"]
281+
tm.assert_frame_equal(result, df)
282+
283+
274284
def test_fixed_offset_tz(setup_path):
275285
rng = date_range("1/1/2000 00:00:00-07:00", "1/30/2000 00:00:00-07:00")
276286
frame = DataFrame(np.random.randn(len(rng), 4), index=rng)

0 commit comments

Comments
 (0)