ArcticDB icon indicating copy to clipboard operation
ArcticDB copied to clipboard

ArcticDB crashes when when trying to normalize timezone data with MsgPack

Open G-D-Petrov opened this issue 11 months ago • 0 comments

Describe the bug

ArcticDB crashes when trying to normalize timestamp with time zone when MsgPack is used as a normalizer. This problem occurs most often when trying to write metadata with a time stamp with a time zone.

N.B.: Time zones are already supported for indexes and not supported for the data in regular columns. This is because regular columns are treated as numpy arrays and numpy doesn't support time zones.

Steps/Code to Reproduce

import pandas as pd
from arcticdb import Arctic

ac = Arctic("lmdb://tz_fix")
lib = ac.get_library("tz_fix", create_if_missing=True)
df = pd.DataFrame([{"dt": pd.Timestamp("2021-01-01", tz="Europe/Amsterdam")}])
df.index = df["dt"]
lib.write(
    "blah",
    data=df,
    metadata={"index_start": pd.Timestamp("2024-03-04", tz="Europe/Amsterdam")},
)

print(lib.read("blah").data.index.tz)
print(lib.read("blah").metadata["index_start"].tz)
print(df.iloc[0].dt.tz)

Expected Results

Should not crash and the time zone in the metadata should be preserved.

OS, Python Version and ArcticDB Version

Python: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] OS: Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 ArcticDB: dev

Backend storage used

LMDB

Additional Context

No response

G-D-Petrov avatar Mar 08 '24 14:03 G-D-Petrov