-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Improve error messages with nicer formatting of Date and Time types #19954
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
base: main
Are you sure you want to change the base?
Conversation
|
Looks great, just a few easy CI errors.LMK if you want me to knock them out. |
|
That would be appreciated ❤️ |
|
Btw, datafusion currently uses Maybe we want to follow arrow-rs here? (…in another PR) |
alamb
left a comment
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.
Looks good to me too --thanks @emilk and @timsaucer
| SELECT | ||
| -- nanoseconds, with no, utc, and local timezone | ||
| arrow_cast(column1, 'Timestamp(Nanosecond, None)') as ts_nano_no_tz, | ||
| arrow_cast(column1, 'Timestamp(ns)') as ts_nano_no_tz, |
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 think it is valuable to have at least a few tests that verify the old syntax still works, FWIW
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 call, added.
| Projection: shapes.shape_id [shape_id:UInt32] | ||
| Unnest: lists[shape_id2|depth=1] structs[] [shape_id:UInt32, shape_id2:UInt32;N] | ||
| Aggregate: groupBy=[[shapes.shape_id]], aggr=[[array_agg(shapes.shape_id) AS shape_id2]] [shape_id:UInt32, shape_id2:List(Field { data_type: UInt32, nullable: true });N] | ||
| Aggregate: groupBy=[[shapes.shape_id]], aggr=[[array_agg(shapes.shape_id) AS shape_id2]] [shape_id:UInt32, shape_id2:List(UInt32);N] |
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.
👍
Displayformatting ofDataType:s in error messages #17565DisplayforDataTypeandFieldarrow-rs#8290Rationale for this change
I believe that error messages should be as readable as possible. Aim for
rustcmore thangcc.Displayis the nice, user-facing formatter.Debugis for… well, debugging.What changes are included in this PR?
Change a bunch of
{:?}format string to{}. I'm sure I missed a lot of them, because I know of no way to enforce this withoutdisallowed_methodson trait impls rust-lang/rust-clippy#8581Are these changes tested?
I assume CI runs
cargo test:)Are there any user-facing changes?
Yes! Error messages should be a bit more readable now.