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] Missing Cypher operators #267

Closed
philippe-bollard opened this issue Sep 5, 2023 · 2 comments · Fixed by #304
Closed

[BUG] Missing Cypher operators #267

philippe-bollard opened this issue Sep 5, 2023 · 2 comments · Fixed by #304
Assignees
Labels
community community Effort - Low Effort - Low feature feature Frequency - Monthly Frequency - Monthly good first issue good first issue Priority - Later Priority - Later Reach - Some Reach - Some Severity - S3 Severity - S3

Comments

@philippe-bollard
Copy link

Environment

  • GQLAlchemy 1.4.1
  • Python 3.9.2
  • Debian 11.7
  • Memgraph 2.9.0

Describe the bug
Some Cypher operators are missing from GQLAlchemy implementation.

I need to use the "=~" operator for a pattern matching query but it's not declared in the enumeration :
https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/query_builders/declarative_base.py#L84

Sadly, it's not possible to build the query without the enum due to this line :
https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/query_builders/declarative_base.py#L184

To Reproduce

Instead of pasting here a lot of my application code, please find below an unstested example adapted from https://memgraph.com/docs/cypher-manual/clauses/where#3-regular-expressions

  1. Build a query using the string '=~' in place of the missing enum operator

query = match().node(labels="Person", variable="n").where(item="n.name", operator="=~", literal=".*a$").return("n")

  1. Run it

query.execute()

  1. It will raise that kind of exception

[...] File "/home/philippe/.local/share/virtualenvs/Engine-tgOo-fyU/lib/python3.9/site-packages/gqlalchemy/query_builders/declarative_base.py", line 950, in and_where self._query.append(AndWhereConditionPartialQuery(item=item, operator=operator, **kwargs)) File "/home/philippe/.local/share/virtualenvs/Engine-tgOo-fyU/lib/python3.9/site-packages/gqlalchemy/query_builders/declarative_base.py", line 212, in __init__ super().__init__(item=item, operator=operator, keyword=Where.AND, **kwargs) File "/home/philippe/.local/share/virtualenvs/Engine-tgOo-fyU/lib/python3.9/site-packages/gqlalchemy/query_builders/declarative_base.py", line 172, in __init__ self.query = self._build_where_query(item=item, operator=operator, **kwargs) File "/home/philippe/.local/share/virtualenvs/Engine-tgOo-fyU/lib/python3.9/site-packages/gqlalchemy/query_builders/declarative_base.py", line 186, in _build_where_query raise GQLAlchemyOperatorTypeError(clause=self.type) gqlalchemy.exceptions.GQLAlchemyOperatorTypeError

Expected behavior

A full support by GQLAlchemy of all Cypher operators (and all related syntax)

Additional context

Patching the enum (declared at https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/query_builders/declarative_base.py#L84) allows to build and run properly a query containing a regex.

@katarinasupe
Copy link
Contributor

Hi @philippe-bollard and thank you for opening the issue 🙏 We are aware that the whole Cypher still isn't supported, and I agree it should be expanded. I can't tell you when this will be worked on since we need to prioritize first. Is this a blocking issue for you or did you manage to continue using Memgraph regardless of that? Are you running Memgraph in production?

@katarinasupe katarinasupe added Effort - Low Effort - Low and removed Effort - Unknown Effort - Unknown labels Dec 28, 2023
@hal-eisen-MG hal-eisen-MG added Priority - Next Priority - Next and removed Priority - Next Priority - Next labels Feb 4, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Next Priority - Next and removed Priority - Next Priority - Next labels Feb 18, 2024
@imilinovic imilinovic mentioned this issue Feb 18, 2024
18 tasks
@imilinovic imilinovic self-assigned this Feb 18, 2024
@imilinovic imilinovic moved this from Todo to In Review in community bugs and incremental features Feb 18, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Next Priority - Next labels Feb 22, 2024
@katarinasupe katarinasupe added Frequency - Monthly Frequency - Monthly Reach - Some Reach - Some and removed Importance - I3 Importance - I3 labels Feb 27, 2024
@katarinasupe
Copy link
Contributor

@imilinovic is #304 fully resolving this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community Effort - Low Effort - Low feature feature Frequency - Monthly Frequency - Monthly good first issue good first issue Priority - Later Priority - Later Reach - Some Reach - Some Severity - S3 Severity - S3
Projects
Development

Successfully merging a pull request may close this issue.

5 participants