Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArcticDB crashes when when trying to normalize timezone data with MsgPack #1406

Open
G-D-Petrov opened this issue Mar 8, 2024 · 0 comments · May be fixed by #1407 or #1866
Open

ArcticDB crashes when when trying to normalize timezone data with MsgPack #1406

G-D-Petrov opened this issue Mar 8, 2024 · 0 comments · May be fixed by #1407 or #1866
Assignees
Labels
bug Something isn't working

Comments

@G-D-Petrov
Copy link
Collaborator

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 G-D-Petrov added the bug Something isn't working label Mar 8, 2024
@G-D-Petrov G-D-Petrov self-assigned this Mar 8, 2024
@G-D-Petrov G-D-Petrov linked a pull request Mar 8, 2024 that will close this issue
5 tasks
@G-D-Petrov G-D-Petrov linked a pull request Mar 8, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants