Skip to content

chore: Reduce repetition in the parameter type inference tests #16079

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jsai28
Copy link
Contributor

@jsai28 jsai28 commented May 18, 2025

Which issue does this PR close?

Closes #16057.

Rationale for this change

Reduces repetition in the parameter type inference tests

What changes are included in this PR?

Added a ParameterTest type to easily create parameter type inference tests.

Are these changes tested?

Tests run successfully.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the sql SQL Planner label May 18, 2025
alamb
alamb previously approved these changes May 19, 2025
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 @jsai28 -- this looks great!

Would you be willing to refactor the remaining tests in this file to use the new structure? We can do it as a follow on PR too I think

@alamb alamb dismissed their stale review May 19, 2025 17:15

clicked wrong button

@jsai28
Copy link
Contributor Author

jsai28 commented May 19, 2025

@alamb Yep I just need to fix that clippy issue and then I'll add it to the rest of the tests. I'll probably just do it in this PR itself

Comment on lines +64 to +65
#[allow(clippy::needless_lifetimes)]
impl<'a> ParameterTest<'a> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can avoid the clippy issue with something like this:

Suggested change
#[allow(clippy::needless_lifetimes)]
impl<'a> ParameterTest<'a> {
impl ParameterTest<'_> {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce repetition in the parameter type inference tests
2 participants