-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GH-43183: [C++] Add date{32,64}
to date{32,64}
cast
#43192
Conversation
|
date
to date
castdate{32,64}
to date{32,64}
cast
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 saw you added tests for Python. Shouldn't we also add tests for C++?
We could put them in scalar_cast_test.cc
. There is a test called TEST(Cast, DateToDate)
in that file we can look at for help.
@Fokko Thank you for your effort! I think LGTM. For more detailed review, @kou (reviewed similar casting logic implementations I did before) or @felipecrv might be able to take a look. |
Thanks for jumping in here @llama90 appreciate it 👍 |
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.
Thank you for reporting and fixing this @Fokko ! Here are some comments.
python/pyarrow/tests/test_ipc.py
Outdated
@@ -1199,6 +1199,25 @@ def make_batches(): | |||
reader = pa.RecordBatchReader.from_batches(None, batches) | |||
pass | |||
|
|||
# https://github.com/apache/arrow/issues/43183 |
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.
If we really want to test this on the Python side, it would be more logical to add a test to test_compute.py
as this is not IPC-related at all.
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.
That makes sense, thanks 👍
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
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.
+1
python/pyarrow/tests/test_compute.py
Outdated
schema = pa.schema([ | ||
('date32', pa.date32()), | ||
('date64', pa.date64()), | ||
]) | ||
|
||
batch = pa.RecordBatch.from_arrays(data, schema=schema) | ||
|
||
table = pa.RecordBatchReader.from_batches( | ||
schema, | ||
[batch] | ||
).cast(schema).read_all() |
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.
Why do we need to create a table here?
Can we use pc.cast()
or Array.cast
like other tests do?
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, certainly. I've been using this code since it was exactly the code that caused issues on my end. I've updated the test 👍
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 5e451d8. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
This one seems to be missing, see #43183
What changes are included in this PR?
Are these changes tested?
I'm not sure what the best place is to test this, please advise
Are there any user-facing changes?
date{32,64}
todate{32,64}
#43183