-
Notifications
You must be signed in to change notification settings - Fork 414
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: improve errors on field cast failures #2932
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2932 +/- ##
=======================================
Coverage 72.35% 72.36%
=======================================
Files 131 131
Lines 40586 40599 +13
Branches 40586 40599 +13
=======================================
+ Hits 29368 29379 +11
Misses 9333 9333
- Partials 1885 1887 +2 ☔ View full report in Codecov by Sentry. |
@jkylling can you fix the tests please |
Fixed the first expected error message in the failing test, but I suspect the next assertion will also fail. Unfortunately I'm unable to run the python tests locally.
|
8c3c63e
to
d75e063
Compare
d75e063
to
aa111b9
Compare
Signed-off-by: R. Tyler Croy <[email protected]>
aa111b9
to
e4bd1df
Compare
Description
Adds information on the field, to-type and from-type when casting fails.
We could consider using our own error type for the casting errors to allow unrolling errors to get the full path to a field. Currently we only give the last part of the path.
When looking at
cast_field
I noticed that we might be missing a match on(DataType::List(_), DataType::LargeList(_))
. Casting List to LargeList can currently cause some tricky behaviour. I had a record batch with a List type, and tried reading it with a LargeList schema. For some choices of schemas it failed with an error message, for other schemas is did not fail, but read the columns in the wrong order.