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

feat: Not expr to string #9802

Merged
merged 7 commits into from
Mar 27, 2024
Merged

feat: Not expr to string #9802

merged 7 commits into from
Mar 27, 2024

Conversation

sebastian2296
Copy link
Contributor

Which issue does this PR close?

This PR adds support for Not expr in #9726

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the sql SQL Planner label Mar 25, 2024
@alamb
Copy link
Contributor

alamb commented Mar 26, 2024

Thanks @sebastian2296 -- if CI passes this PR looks great to me

@@ -711,6 +718,10 @@ mod tests {
Expr::IsUnknown(Box::new((col("a") + col("b")).gt(lit(4)))),
r#"(("a" + "b") > 4) IS UNKNOWN"#,
),
(
Expr::Not(Box::new(col("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 could write this more concisely using https://docs.rs/datafusion/latest/datafusion/logical_expr/fn.not.html

So something like not(col(a))

@sebastian2296
Copy link
Contributor Author

Hi @alamb, clippy test is failing due to unused ´not´ import, but that's not true. I'm using it to perform the test. Any hints on what could be the issue here?

@devinjdangelo
Copy link
Contributor

Hi @alamb, clippy test is failing due to unused ´not´ import, but that's not true. I'm using it to perform the test. Any hints on what could be the issue here?

Hey @sebastian2296 if you are using an import only for a test, you can import it within the mod tests {} block. E.g.

use regular_dependency;

fn some_code(){
  ()
}

mod tests{
    use test_dependency;
    ...

}

Thank you for the work on this PR! 🙏

@alamb
Copy link
Contributor

alamb commented Mar 26, 2024

🚀 -- thanks again @sebastian2296

@alamb
Copy link
Contributor

alamb commented Mar 26, 2024

Thanks @sebastian2296 -- this PR needs to be merged up from main to resolve a conflct. Can you do so so that I can merge it in?

Thanks again 🙏

@sebastian2296
Copy link
Contributor Author

Done! @alamb

@alamb alamb merged commit ccd850b into apache:main Mar 27, 2024
23 checks passed
@alamb
Copy link
Contributor

alamb commented Mar 27, 2024

Thanks @sebastian2296 -- a very nice addition indeed

Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Apr 1, 2024
* feat: Not  expr to string

* fix: use not logical expr

* fix: format using fmt

* fix: import within test mod

* fix: format new import
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.

3 participants