Skip to content

feat: add IS NOT NULL operator to query builder#376

Open
LakshmiSravyaVedantham wants to merge 1 commit intomemgraph:mainfrom
LakshmiSravyaVedantham:feature/is-not-null-operator
Open

feat: add IS NOT NULL operator to query builder#376
LakshmiSravyaVedantham wants to merge 1 commit intomemgraph:mainfrom
LakshmiSravyaVedantham:feature/is-not-null-operator

Conversation

@LakshmiSravyaVedantham
Copy link
Copy Markdown

Summary

  • Adds IS_NOT_NULL = "IS NOT NULL" to the Operator enum
  • Updates _build_where_query() to handle unary operators that don't require a literal or expression argument
  • Enables usage: where(item='n.name', operator=Operator.IS_NOT_NULL)WHERE n.name IS NOT NULL

Closes #293

Test plan

  • match().node(variable='n').to().node(variable='m').where(item='n.name', operator=Operator.IS_NOT_NULL).return_() should produce MATCH (n)-[]->(m) WHERE n.name IS NOT NULL RETURN *;
  • Existing where() calls with literal/expression should continue working unchanged

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


lakshmisravya123 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@antejavor antejavor self-assigned this Mar 20, 2026
@antejavor
Copy link
Copy Markdown
Contributor

Hi @LakshmiSravyaVedantham, thanks for the contribution. Can you sign the CLA?

Copy link
Copy Markdown
Contributor

@antejavor antejavor left a comment

Choose a reason for hiding this comment

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

Let's just drop the comment and a test for this PR, CI passes and if we merge 🦾

if operator_str not in Operator._value2member_map_:
raise GQLAlchemyOperatorTypeError(clause=self.type)

# Unary operators (e.g., IS NOT NULL) don't require a literal or expression
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Unary operators (e.g., IS NOT NULL) don't require a literal or expression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add IS NOT NULL to query builder

3 participants