-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: support datetime related casting in (Series|DataFrame|Index).astype #442
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.
Leave minor comment. Overall LGTM.
): | ||
bf_result = scalars_df_index[column].astype(to_type).to_pandas() | ||
pd_result = scalars_pandas_df_index[column].astype(to_type) | ||
pd.testing.assert_series_equal(bf_result, pd_result, check_dtype=False) |
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.
Can we add another assert to make sure the type of bf_result
is expected, though it may be different as pd_result
?
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.
Good idea!
|
||
if x.type() == ibis_dtypes.int64: | ||
# The conversion unit is set to "us" (microseconds) for consistency | ||
# with pandas converting timestamp[us][pyarrow] to int64[pyarrow]. |
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.
Double check if the comment matches the code? It is converting int64[pyarrow]
to timestamp[us][pyarrow]
, rather the opposite direction?
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.
Good catch!
* chore: add deferred exec code samples * fix tests * fix tests
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
Fixes internal bug: b/328114618 🦕