gjoseph92 / stackstac

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

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

Open bastien-k opened 11 months ago

bastien-k commented 11 months 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 11 months 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.)