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

Support dots and slashes in extra filters #106

Closed
yndai opened this issue Oct 9, 2024 · 7 comments · Fixed by #114
Closed

Support dots and slashes in extra filters #106

yndai opened this issue Oct 9, 2024 · 7 comments · Fixed by #114
Labels
bug Something isn't working lexer parser
Milestone

Comments

@yndai
Copy link

yndai commented Oct 9, 2024

Hi, first of all, really like this tool!

One use case I have is to filter on an annotation with dots an slashes, but I don't think this is supported? Please correct me if I'm wrong. For example something like:

MATCH (d:Deployment)
WHERE d.metadata.annotations.meta\.helm\.sh/release-name="my-app"
RETURN d.metadata.name;

results in a parse error: Error: unexpected $end Error >> error parsing query >> parsing failed

I also tried some variations of brackets and quotes, but they don't seem to return any results:

...
WHERE d.metadata.annotations[meta.helm.sh/release-name]="my-app"
...

I saw that this is supported in label matching: #99, but I don't believe this works for annotations.

@AvitalTamir
Copy link
Owner

Hi @yndai thanks for reporting! Indeed, we need to support this probably using escape slashes.

Good catch, this is an important one.

@AvitalTamir AvitalTamir added bug Something isn't working parser lexer labels Oct 10, 2024
@AvitalTamir AvitalTamir added this to the v0.13 milestone Oct 10, 2024
@AvitalTamir AvitalTamir linked a pull request Oct 13, 2024 that will close this issue
@AvitalTamir
Copy link
Owner

Resolved in #114

@reitzig
Copy link

reitzig commented Feb 6, 2025

I have a hard time extracting the supported syntax from #114, and LANGUAGE.md doesn't seem to mention escaping.

Is this what should work?

MATCH (d:Deployment)
WHERE d.metadata.annotations.meta\.helm\.sh/release-name="my-app"
RETURN d.metadata.name;

Because I'm getting

An error occurred while executing the query: Error: Error parsing query: parse error: parsing first clause: expected operator, got "\"

with v0.15.3.

Pre-emptive follow-up: I came here looking for how to do this:

MATCH (d:Deployment {namespace: "my-namespace"})
RETURN d.metadata.annotations.meta\.helm\.sh/release-name;

to feed into helm uninstall. Is the same escaping already supported for RETURN?

@AvitalTamir
Copy link
Owner

Hey @reitzig, thanks for reporting this!
the syntax is correct - this looks like a regression on our part from a recent parser rewrite.
I'll put out a patch and tests for this and also document escaping in the language doc, will release asap.

@AvitalTamir AvitalTamir reopened this Feb 6, 2025
@AvitalTamir
Copy link
Owner

FYI PR is ready, we'll push out a new release in a couple of hours
#190

@reitzig
Copy link

reitzig commented Feb 11, 2025

Whoa, that was fast, thanks a bunch! 💚

@AvitalTamir
Copy link
Owner

@reitzig thank YOU for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lexer parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants