Skip to content

Commit 9965eb3

Browse files
committed
TST: HDF5 roundtrip of empty tz-aware dataframe
1 parent bc16438 commit 9965eb3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pandas/tests/io/pytables/test_timezones.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def test_tseries_select_index_column(setup_path):
268268
assert rng.tz == result.dt.tz
269269

270270

271-
def test_timezones_fixed(setup_path):
271+
def test_timezones_fixed_format_frame_non_empty(setup_path):
272272
with ensure_clean_store(setup_path) as store:
273273

274274
# index
@@ -296,6 +296,16 @@ 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_frame_empty(setup_path, dtype):
301+
with ensure_clean_store(setup_path) as store:
302+
s = Series(dtype=dtype)
303+
df = DataFrame({"A": s})
304+
store["df"] = df
305+
result = store["df"]
306+
tm.assert_frame_equal(result, df)
307+
308+
299309
def test_fixed_offset_tz(setup_path):
300310
rng = date_range("1/1/2000 00:00:00-07:00", "1/30/2000 00:00:00-07:00")
301311
frame = DataFrame(np.random.randn(len(rng), 4), index=rng)

0 commit comments

Comments
 (0)