-
Notifications
You must be signed in to change notification settings - Fork 807
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
Return error instead of assert when meeting incompatitble type #4995
Comments
In general we use assertions for invariants that are not expected to be encountered in a well-formed program. I'm not sure that a well-formed program should be able to hit this as it would indicate some form of schema inconsistency, but then I'm also not opposed to making this an error. |
I've just hit this panic as well, and it's definitely because I'm messing up the schemas somewhere, but it's hard to tell what the problem is from the panic message. At the very least, I expected some Arrow method in the call stack of the backtrace to have documentation with a "Panics" section that details the invariant that I'm not upholding, but I don't see any (and I'm not sure exactly where it should go). I'd be happy to send in a documentation PR if given some guidance for where it should go! Backtrace
Places I looked for documentation:
|
Oh I see what has happened, at some point the schema check got removed from ArrowWriter, possibly #4871, you can see it in this PR - https://github.com/apache/arrow-rs/pull/4027/files#diff-dbb6b7806a48ce2b6fb40ce4a429599808a87671274ee6b2dc7c1f87429320b3R135 As such you can now hit this panic. We should change it to be an error with a more descriptive message. Edit: especially as compute_leaves is now public and so this can also be hit that way |
arrow-rs/parquet/src/arrow/arrow_writer/levels.rs
Line 135 in b07dabe
When I use the writer and pass incompatitble type, it will panic instead of return a error. Maybe it should return a error here or other place? 🧐
The text was updated successfully, but these errors were encountered: