Add IS NOT NULL operator to query builder#390
Open
syzayd wants to merge 1 commit into
Open
Conversation
Adds Operator.IS_NOT_NULL as the query builder's first unary (postfix) operator: where() takes neither literal nor expression for it, and passing either raises GQLAlchemyExtraKeywordArguments. Includes tests mirroring the IN operator's, a docstring update, and a how-to guide section. Closes memgraph#293 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FTdT6AcZMfnUfhiNA92T5e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #293.
What
Adds
Operator.IS_NOT_NULLto the query builder, so property-existence filters can be expressed:How
IS NOT NULLis the query builder's first unary (postfix) operator, so besides the enum entry,WhereConditionPartialQuery._build_where_querygains a small unary branch:literalnorexpression; the condition is rendered asitem IS NOT NULLliteralorexpressionwith a unary operator raisesGQLAlchemyExtraKeywordArguments, consistent with the existing "extra keyword arguments" semantics_UNARY_OPERATORS), so a futureIS NULLis a two-line follow-up - happy to add it in this PR if you want the symmetric operator tooTests and docs
test_where_is_not_null,test_and_where_is_not_null(chaining), plus two error-path tests forliteral/expressionmisuse - same style as the recently mergedINoperator tests (Add IN operator to query builder #379)where()docstring updated and anIS NOT NULLsection added to the query-builder how-to guide, mirroring theINsectionpytest tests/query_builders/test_query_builders.pyplusblack --checkandflake8on the touched files locally - all greenNote
#293 shows a 2024 assignment; since the issue is still open with recent community interest and no linked PR, I hope a community contribution is welcome - happy to defer or adjust if work is already underway.