-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Print incorrect tz argument in error message #25420
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
Conversation
Anyone can merge post CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good, but perhaps more fundamentally is that dates.py does not define allowable units...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there seems to be a bit of "abuse" of things. This line doesn't really look like one would hope for:
matplotlib/lib/matplotlib/dates.py
Line 1798 in 75a35e0
To me it seems like one is patching dates to, sort of, work with units. But then I have very limited insights into how the units do work.
There can for sure be better fixes for this, but this one the one I could add to at least improve the situation slightly...
My interpretation of the problem is that there is no checking for validity when setting the units. Then, when setting timezone through axis_date
, whatever is set as self.units
of the Axis
is used and an AutoDateLocator
is instantiated with that as tz
...
PR Summary
Related to #25419.
It would have been slightly easier to realize that something surprising was going on if one could have seen the incorrectly passed
tz
argument (which was not the one that a user would expect that they had just passed...).PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst