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

Fix CASE example #901

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Fix CASE example #901

merged 3 commits into from
Mar 6, 2024

Conversation

gem-neo4j
Copy link
Contributor

There was an ambiguous case we had to remove in CASE expressions.

@@ -107,9 +107,9 @@ The supported comparators are:

* xref::syntax/operators.adoc#query-operators-comparison[Regular Comparison Operators]: `+=+`, `+<>+`, `+<+`, `+>+`, `+<=+`, `+>=+`
* xref:values-and-types/working-with-null.adoc#is-null-is-not-null[`IS NULL` Operator]: `IS [NOT] NULL`
* xref:values-and-types/type-predicate.adoc[Type Predicate Expression]: `IS [NOT] :: <TYPE>`
* xref:values-and-types/type-predicate.adoc[Type Predicate Expression]: `IS [NOT] TYPED <TYPE>` (Note: the form `IS [NOT] :: <TYPE>` is not currently accepted as it leads to an ambiguous grammar)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* xref:values-and-types/type-predicate.adoc[Type Predicate Expression]: `IS [NOT] TYPED <TYPE>` (Note: the form `IS [NOT] :: <TYPE>` is not currently accepted as it leads to an ambiguous grammar)
* xref:values-and-types/type-predicate.adoc[Type Predicate Expression]: `IS [NOT] TYPED <TYPE>` (Note that the form `IS [NOT] :: <TYPE>` is currently not accepted as it leads to ambiguous grammar)

what is the ambiguity? would it make sense to add an example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think an example might be more confusing to users, it was a very niche edge case:

WITH "this is a string" AS IS
RETURN CASE 1
WHEN IS :: INT THEN "1 is an int"
ELSE "the IS is actually a variable so this is returned"
END

Copy link
Contributor

@JPryce-Aklundh JPryce-Aklundh Mar 5, 2024

Choose a reason for hiding this comment

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

I don't think we need to give a reason here, and we also try to avoid words like "currently". In other words, can't we just say "Note that the form... is not accepted", and then change it in the future, if and when it becomes necessary?

@neo-technology-commit-status-publisher
Copy link
Collaborator

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@JPryce-Aklundh JPryce-Aklundh merged commit d41334d into neo4j:dev Mar 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants