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

Bug: Fix incorrect is_not_null() implementation #553

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

kbolashev
Copy link
Member

Before this PR running a query like:

q = ds["col1"] > 2
q = q["col2"].is_not_null()

Will lead to building a query tree resolving to NOT (col1 > 2 AND col2 IS NULL)
The expected query for this code should have been col1 > 2 AND NOT (col2 IS NULL)

This PR fixes it by introducing a ! prefix on a QueryTree operand, that makes it so the operand gets prepended with a not node, which how you would expect an is_not_null to behave

Added a test for this. Everything in test_querying.py after line 560 is just autoformatting.

@kbolashev kbolashev added the bug Something isn't working label Nov 18, 2024
@kbolashev kbolashev self-assigned this Nov 18, 2024
Copy link

dagshub bot commented Nov 18, 2024

@kbolashev kbolashev merged commit 0befc57 into master Nov 19, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants