gjoseph92 / stackstac

Turn a STAC catalog into a dask-based xarray
https://stackstac.readthedocs.io
MIT License
232 stars 49 forks source link

Remove deprecated argument #218

Open clausmichele opened 11 months ago

clausmichele commented 11 months ago

Removing the deprecated argument 'infer_datetime_format'. This is the deprecation warning by Pandas:

stackstac\stackstac\prepare.py:369: UserWarning: The argument 'infer_datetime_format' is deprecated and will be removed in a future version. A strict version of it is now the default, see https://pandas.pydata.org/pdeps/0004-consistent-to-datetime-parsing.html. You can safely remove this argument. times = pd.to_datetime(

gjoseph92 commented 11 months ago

Thanks for the PR @clausmichele. See some discussion here: https://github.com/gjoseph92/stackstac/issues/213#issuecomment-1693869558.

Would you mind either adding pandas>=2.0.0 (pdm add pandas>=2) to the dependencies, or making this conditional on the pandas version, like

PANDAS_2 = importlib.metadata.version('pandas')[0] == "2"  # hacky
...
pd.to_datetime(
    ...
    **({"infer_datetime_format": True} if not PANDAS_2 else {})
)
clausmichele commented 11 months ago

@gjoseph92 alright I will try to make it conditional as you suggested! I missed the other issue mentioning it.

renaudjester commented 9 months ago

Hi! Almost created an issue but I saw this pull request @clausmichele and @gjoseph92 any idea when this will be merged?

clausmichele commented 9 months ago

I won't have time to work on this until mid November unfortunately.

gjoseph92 commented 9 months ago

@clausmichele I can take this over in that case then, if you'd like?

clausmichele commented 9 months ago

@gjoseph92 sure, thanks a lot for the effort you put in this project.

gjoseph92 commented 7 months ago

FYI, requiring pandas 2 seems to be the best way forward: https://github.com/gjoseph92/stackstac/issues/235#issuecomment-1858906028

eugsokolov commented 1 month ago

hi - i was thinking to make a PR to get rid of the warning and saw this. any plans to merge this in or is there a discussion elsewhere that is stopping this from going through?