gjoseph92 / stackstac

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

Pandas UserWarning: The argument 'infer_datetime_format' is deprecated #213

Closed bastien-k closed 3 months ago

bastien-k commented 1 year ago

https://github.com/gjoseph92/stackstac/blob/e30ecf233ee42c1c98fcfbc5178ff105ba60760e/stackstac/prepare.py#L383

With pandas 2.0.3, this line returns a UserWarning:

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.
gjoseph92 commented 1 year ago

Thanks for pointing this out @bastien-k. Would you have any interest in submitting a fix? Seems like just removing that argument and setting the minimum pandas version to 2.0.3 would do it. (Though I'm a little hesitant to require newer pandas just for that; idk if pandas 2.0 would cause issues for any users.)

gjoseph92 commented 3 months ago

Finally fixed in 0.5.1, now available on pypi