Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fabmid opened this issue May 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@fabmid
Copy link

fabmid commented May 22, 2023

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 fabmid added the bug Something isn't working label May 22, 2023
@GabesSmith
Copy link

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

@peterdudfield
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants