From 6c184b25b2fe31f899bb3e895e63f5d72d6a4733 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Tue, 29 Aug 2023 18:36:18 +0200 Subject: [PATCH] test: Remove test for fallback to pickle Signed-off-by: Julien Jerphanion --- .../version_store/test_empty_writes.py | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/python/tests/unit/arcticdb/version_store/test_empty_writes.py b/python/tests/unit/arcticdb/version_store/test_empty_writes.py index b061f4d060..c73f37e9d9 100644 --- a/python/tests/unit/arcticdb/version_store/test_empty_writes.py +++ b/python/tests/unit/arcticdb/version_store/test_empty_writes.py @@ -142,38 +142,3 @@ def test_empty_series(lmdb_version_store_dynamic_schema, sym): ser.index = ser.index.astype("datetime64[ns]") assert_series_equal(lmdb_version_store_dynamic_schema.read(sym).data, ser) - - -def test_fallback_to_pickle(lmdb_version_store, sym): - column_names = ["a", "b", "c"] - df = pd.DataFrame(columns=column_names) - lmdb_version_store.write(sym, df) - - # In Pandas 2.0, RangeIndex is used by default when an empty dataframe or series is created. - # The index is converted to a DatetimeIndex for preserving the behavior of ArcticDB with Pandas 1.0. - assert isinstance(df.index, pd.RangeIndex if IS_PANDAS_TWO else pd.Index) - - if IS_PANDAS_TWO: - # In Pandas 2.0, RangeIndex is used by default when an empty dataframe or series is created. - # The index has to be converted to a DatetimeIndex by ArcticDB to perform updates. - df.index = df.index.astype("datetime64[ns]") - - # Before Pandas 2.0, empty Series' dtype was "float64" and empty DataFrames' Columns' dtype was "object". - # As of Pandas 2.0, empty Series' dtype is "object" and empty DataFrames' Columns' dtype remains "object". - # See: https://github.com/pandas-dev/pandas/issues/17261 - # When normalizing in Pandas 2.0, we convert empty Series' dtype to float to "float64" to be consistent - # with the behavior of ArcticDB with Pandas 1.0. - # The same logic is used to normalize empty DataFrames' columns. - - # Hence: - if IS_PANDAS_TWO: - # In Pandas 2.0, empty Dataframes can now be stored without being pickled. - assert not lmdb_version_store.is_symbol_pickled(sym) - # and ArcticDB returns empty DataFrames with float64 for all columns if they have not been specified. - df = df.astype("float64", copy=False) - assert_frame_equal(df, lmdb_version_store.read(sym).data) - else: - # In Pandas 1.0, empty Dataframes are pickled. - assert lmdb_version_store.is_symbol_pickled(sym) - # and ArcticDB simply deserialize empty DataFrames. - assert_frame_equal(df, lmdb_version_store.read(sym).data)