Skip to content
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

Merged
merged 2 commits into from
Jul 10, 2024
Merged

Minor: Change no-statement error message to be clearer #11394

merged 2 commits into from
Jul 10, 2024

Conversation

itsjunetime
Copy link
Contributor

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.

@github-actions github-actions bot added the core Core DataFusion crate label Jul 10, 2024
@alamb
Copy link
Contributor

alamb commented Jul 10, 2024

Thanks @itsjunetime ! I started the CI on this PR -- once that passes I think this PR will be good to go.

@alamb
Copy link
Contributor

alamb commented Jul 10, 2024

@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 cargo fmt and pushing the result

@itsjunetime
Copy link
Contributor Author

@alamb thank you for catching that - I guess I forgot to run it earlier. All should be good now.

@alamb
Copy link
Contributor

alamb commented Jul 10, 2024

@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)

@alamb alamb changed the title Change no-statement error message to be clearer Minor: Change no-statement error message to be clearer Jul 10, 2024
Copy link
Contributor

@alamb alamb left a 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"
Copy link
Contributor

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

@alamb
Copy link
Contributor

alamb commented Jul 10, 2024

🚀

@alamb alamb merged commit cc7484e into apache:main Jul 10, 2024
24 checks passed
crepererum added a commit to crepererum/arrow-datafusion that referenced this pull request Jul 11, 2024
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.
crepererum added a commit to crepererum/arrow-datafusion that referenced this pull request Jul 11, 2024
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.
crepererum added a commit to crepererum/arrow-datafusion that referenced this pull request Jul 11, 2024
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.
crepererum added a commit that referenced this pull request Jul 11, 2024
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.
Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Jul 12, 2024
* Change no-statement error message to be clearer and add tests for said change

* Run fmt to pass CI
Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Jul 12, 2024
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.
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* Change no-statement error message to be clearer and add tests for said change

* Run fmt to pass CI
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
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.
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 17, 2024
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.
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 17, 2024
* Change no-statement error message to be clearer and add tests for said change

* Run fmt to pass CI
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 18, 2024
* Change no-statement error message to be clearer and add tests for said change

* Run fmt to pass CI
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 18, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

This context requires a statement! error message can be confusing
2 participants