-
Notifications
You must be signed in to change notification settings - Fork 590
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
ENH: Namespace time_col config, fix type check for trim_with_timecontext for pandas window execution. #2680
ENH: Namespace time_col config, fix type check for trim_with_timecontext for pandas window execution. #2680
Conversation
|
|
||
| # Filter the data, here we preserve the time index so that when user is | ||
| # computing a single column, the computation and the relevant time | ||
| # indexes are returned. | ||
| time_col = get_time_col() | ||
| if time_col not in df or not is_datetime64_dtype(df[time_col]): | ||
| if time_col not in df or not is_datetime64_any_dtype(df[time_col]): |
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.
Do we have test for this
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.
Removed this, not hitting by any user level APIs
| @@ -95,7 +95,7 @@ def test_context_adjustment_window_udf( | |||
| """ This test case aims to test context adjustment of | |||
| udfs in window method. | |||
| """ | |||
| with option_context('time_col', 'timestamp_col'): | |||
| with option_context('timecontext.time_col', 'timestamp_col'): | |||
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.
should be under a the namespace context_adjustment
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.
How about timecontext_adjustment? We have been calling this timecontext instead of context all over the place
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.
Use context_adjustment as suggested
4148fb9
to
c172631
Compare
71116d5
to
6e36706
Compare
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
|
thanks @LeeTZ |
Overview
As a follow-up of #2646, add namespace
timecontextfor the ibis configtime_col.Also, fix a type check in
trim_with_time_contextfor pandas window execution. The type check to check a DataFrame has atime_colcolumn and its type is a Datetime type, will not hit by any user level APIs, removing it.For the result series of a Groupby Transform. The result series is still using the name of the input series. We should unset it to avoid confusion. e.g. If the input series is 'time' and the result series is float but still named 'time' Then in trimming with context the series will be identified as a time column and result in an error.
Tests
Still using the tests implemented in
ibis/backends/tests/test_timecontext.py, andibis/backends/execution/pandas/test_timecontext.py