pvoutput icon indicating copy to clipboard operation
pvoutput copied to clipboard

TypeError: Cannot localize tz-aware Timestamp, use tz_convert for conversions in quick_start.ipynb

Open fabmid opened this issue 1 year ago • 2 comments

Dear all,

I tried the quick_start.ipynb example and get the following error:

_TypeError: Cannot localize tz-aware Timestamp, use tz_convert for conversions

File ~\anaconda3\envs\pvoutput\lib\site-packages\pvoutput\pvoutput.py:1052 in _set_rate_limit_params self.rate_limit_reset_time = self.rate_limit_reset_time.tz_localize("utc")

File pandas_libs\tslibs\timestamps.pyx:2098 in pandas.libs.tslibs.timestamps.Timestamp.tz_localize

To Reproduce: pip install pvoutput-ocf I use python 3.8

Thanks in advance for the support. Fabi

fabmid avatar May 22 '23 14:05 fabmid

change from:

self.rate_limit_reset_time = self.rate_limit_reset_time.tz_localize("utc")

to:

self.rate_limit_reset_time = self.rate_limit_reset_time.tz_convert("utc")

fixes this issue on Python 3.11.4

GabesSmith avatar Aug 07 '23 11:08 GabesSmith

Thanks @GabesSmith for this. would you be interested in doing a PR for this?

peterdudfield avatar Sep 11 '23 20:09 peterdudfield