-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix: should raise exception when apply a categorical axis #20451
Conversation
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.
LGTM
(cherry picked from commit 8bbbd6f)
(cherry picked from commit 8bbbd6f)
@@ -322,6 +322,16 @@ def processing_time_offsets( # pylint: disable=too-many-locals | |||
# multi-dimensional charts | |||
granularity = query_object.granularity | |||
index = granularity if granularity in df.columns else DTTM_ALIAS | |||
if not pd.api.types.is_datetime64_any_dtype( |
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.
Based on recent errors I'm guessing this is too restrictive.
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.
Guessing this should be is_datetime64_any_dtype(...) or is_datetime64tz_any_dtype(...)
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.
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.
is_datetime64_any_dtype
verify is_datetime64tz_any_dtype
as well, https://github.com/pandas-dev/pandas/blob/e8093ba372f9adfe79439d90fe74b0b5b6dea9d6/pandas/core/dtypes/common.py#L922
SUMMARY
Raise a specified error when using categorical x-axis and time comparison.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After
Before
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION