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

Pandas 2.0 compatibility #21

Closed
anthonyozerov opened this issue Jun 1, 2023 · 0 comments · Fixed by #24
Closed

Pandas 2.0 compatibility #21

anthonyozerov opened this issue Jun 1, 2023 · 0 comments · Fixed by #24

Comments

@anthonyozerov
Copy link
Collaborator

Pandas 2.02 is currently installed upon a fresh install of bolides into a clean environment. Per the Pandas devs in their 2.0.0 release notes, one change is:

"Enforced deprecation disallowing using .astype to convert a timezone-aware Series, DataFrame, or DatetimeIndex to timezone-naive datetime64[ns] dtype, use obj.tz_localize(None) or obj.tz_convert("UTC").tz_localize(None) instead (GH39258)"

This leads to a problem upon simply calling BolideDataFrame() due to this now-deprecated line of code:

df["datetime"] = df["datetime"].astype("datetime64")

with the following error raised:
TypeError: Cannot use .astype to convert from timezone-aware dtype to timezone-naive dtype. Use obj.tz_localize(None) or obj.tz_convert('UTC').tz_localize(None) instead.

This should be easy to fix and there is no need to specify an older version of Pandas in the package dependencies. More testing is required to check that other package features are compatbile the newest Pandas version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant