Open mborsetti opened 3 years ago
Yes, this needs fixing, if anyone has the time to sort out the details. Patches welcome, as always.
Hi, I've just came across this issue because I encountered the same problem. I'd like to suggest you to try using pandas.to_datetime
, this datetime object would then be tz aware. I'm about to do that for my app... Good luck!
Confirming all of the above, as numerous lines of the above error message are generated, which is quite undesirable.
Referencing, an issue that reviewed numpy's decision to allow this error message to persist: https://github.com/numpy/numpy/issues/23904
Lastly, confirming the comment made by @adRn-s as potentially the best approach towards resolution. Which is mentioned in several other sources.
When running tests, I am getting the following warning from
numpy
(current version):Per developer's manual at https://numpy.org/devdocs/reference/arrays.datetime.html#basic-datetimes
The code below takes a timezone-aware datetime, converts it to UTC, and turns it into a timezone unaware one that can be passed to numpy. However, I am not sure the full functioning of the code and where it would need to be used in order not to introduce undesirable side effects (bugs).
d = d.astimezone(tz=datetime.timezone.utc).replace(tzinfo=None)