Skip to content

Pandas 2.0 compatibility #21

Closed
Closed
@anthonyozerov

Description

@anthonyozerov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions