-
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
[Python] regression: cannot cast string scalar to date32 #37411
Comments
Hmm, that's unfortunate. It's indeed caused by switching to the standard cast compute kernels, instead of using the custom (and in other ways more limited) Scalar cast implementation. But so clearly that also supported some things not yet supported in the cast kernels. I am not sure if there would be an easy way to fix the regression (apart from reverting), except for adding the "string->date32" cast kernel (although that's something we should do anyway). The "string -> timestamp" kernel lives here: arrow/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc Lines 410 to 452 in 9b6be29
It might not be too hard to add a date32 version, essentially using the above but changing |
…alar cast) (#38038) ### Rationale for this change Adding `string -> date32/date64` cast kernels, which then also fixes the pyarrow scalar cast method (which was earlier refactored to rely on the general cast kernels) * Closes: #37411 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
…hon scalar cast) (apache#38038) ### Rationale for this change Adding `string -> date32/date64` cast kernels, which then also fixes the pyarrow scalar cast method (which was earlier refactored to rely on the general cast kernels) * Closes: apache#37411 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
…hon scalar cast) (apache#38038) ### Rationale for this change Adding `string -> date32/date64` cast kernels, which then also fixes the pyarrow scalar cast method (which was earlier refactored to rely on the general cast kernels) * Closes: apache#37411 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
…hon scalar cast) (apache#38038) ### Rationale for this change Adding `string -> date32/date64` cast kernels, which then also fixes the pyarrow scalar cast method (which was earlier refactored to rely on the general cast kernels) * Closes: apache#37411 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
Describe the bug, including details regarding any error messages, version, and platform.
In PyArrow 12, you could do:
But in PyArrow 13, this no longer works:
This is likely due to the changes in: #35040
There is a scalar cast implementation for string -> date32, but no array implementation.
Component(s)
Python
The text was updated successfully, but these errors were encountered: