Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment_unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies:
- python =3.10 # Python 3.11 requires protobuf>=4
- packaging
- numpy
- pandas < 2
- pandas
- pytest
- boto3
- werkzeug
Expand Down
6 changes: 3 additions & 3 deletions python/arcticdb/version_store/_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,10 @@ def denormalize(self, item, norm_meta):
if key in data:
category_info = list(norm_meta.common.categories[key].category)
codes = data[key]
# `pd.Categorical.from_codes` from `pandas~=0.25.x` (pandas' supported version for python 3.6)
# does not support `codes` of `dtype=object`: it has to have an integral dtype.
# See: https://github.com/pandas-dev/pandas/blob/0.25.x/pandas/core/arrays/categorical.py#L688-L704
if IS_PANDAS_ZERO:
# `pd.Categorical.from_codes` from `pandas~=0.25.x` (pandas' supported version for python 3.6)
# does not support `codes` of `dtype=object`: it has to have an integral dtype.
# See: https://github.com/pandas-dev/pandas/blob/0.25.x/pandas/core/arrays/categorical.py#L688-L704
codes = np.asarray(codes, dtype=int)
df[key] = pd.Categorical.from_codes(codes=codes, categories=category_info)
for key in norm_meta.common.int_categories:
Expand Down
2 changes: 1 addition & 1 deletion python/tests/scripts/test_update_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import pytest
import pandas as pd
from pandas.util.testing import assert_frame_equal

from arcticdb import Arctic
from arcticdb.scripts.update_storage import run
from arcticdb.options import LibraryOptions
from arcticc.pb2.s3_storage_pb2 import Config as S3Config
from arcticc.pb2.azure_storage_pb2 import Config as AzureConfig
from arcticdb.util.test import assert_frame_equal

from arcticdb.adapters.s3_library_adapter import USE_AWS_CRED_PROVIDERS_TOKEN
from arcticdb_ext.tools import AZURE_SUPPORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
import pandas as pd
from pandas.tseries.offsets import MonthBegin
import pytest
import sys

from arcticdb.util.test import assert_frame_equal
from arcticdb.util._versions import IS_PANDAS_TWO
from arcticdb_ext.tools import AZURE_SUPPORT


Expand Down Expand Up @@ -82,9 +80,7 @@ def test_stress_multicolumn(lib_type, request):
output_df = lib.read(name).data
print("reading from arctic native: {}".format(pd.Timestamp("now") - now))

if IS_PANDAS_TWO and test_data.empty:
# 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.
test_data.index = test_data.index.astype("datetime64[ns]")

assert_frame_equal(test_data, output_df)
# ArcticDB stores empty columns under a dedicated `EMPTYVAL` type, so the types are not going
# to match with pandas until the first append.
is_not_empty = not test_data.empty
assert_frame_equal(test_data, output_df, check_dtype=is_not_empty, check_index_type=is_not_empty)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
#
# See: https://conda-forge.org/feedstock-outputs/
numpy
pandas <2
pandas
attrs
dataclasses ; python_version < '3.7'
grpcio-tools
Expand Down