-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Minor: Change no-statement error message to be clearer #11394
Conversation
Thanks @itsjunetime ! I started the CI on this PR -- once that passes I think this PR will be good to go. |
@itsjunetime it appears that the CI job https://github.com/apache/datafusion/actions/runs/9877944034/job/27282735257?pr=11394 failed I think you can resolve this by doing |
@alamb thank you for catching that - I guess I forgot to run it earlier. All should be good now. |
LOL -- well the CI checks caught it, I just figured I would point it out in case you hadn't seen it (I am not really sure how other people have their github alert settings configured. I get a 🚒 hose so miss stuff sometimes) |
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.
Thanks @itsjunetime -- this looks like a nice improvement to me
.await; | ||
assert_eq!( | ||
plan_res.unwrap_err().strip_backtrace(), | ||
"This feature is not implemented: The context currently only supports a single SQL statement" |
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 adding additional test coverage
🚀 |
Amends apache#11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
Amends apache#11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
Amends apache#11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
Amends #11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
* Change no-statement error message to be clearer and add tests for said change * Run fmt to pass CI
Amends apache#11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
* Change no-statement error message to be clearer and add tests for said change * Run fmt to pass CI
Amends apache#11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
Amends apache#11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
* Change no-statement error message to be clearer and add tests for said change * Run fmt to pass CI
* Change no-statement error message to be clearer and add tests for said change * Run fmt to pass CI
Amends apache#11394 (sorry, I should have reviewed that). While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.
Which issue does this PR close?
Closes #11393 .
Rationale for this change
This is a much clearer error message than previously existed in its place.
What changes are included in this PR?
This changes the error message and adds two tests: one to cover this exact use case (of no statements being provided) and another to cover the instance of multiple statements being provided (which returns an error right before the check to see if any statements were provided at all), since there were no tests for that error case.
Are these changes tested?
Yes, running
cargo test
in the root of the repo produces no failures.Are there any user-facing changes?
I think this qualifies as a user-facing change, but I don't think it violates any invariants or changes any use-cases (or anything like that) in a way that would require any documentation changes. I may be wrong, though - clarification on if this qualifies as a 'user-facing change' would be appreciated.