Closed philippe-bollard closed 4 months ago
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?
@imilinovic is #304 fully resolving this issue?
Environment
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
query = match().node(labels="Person", variable="n").where(item="n.name", operator="=~", literal=".*a$").return("n")
query.execute()
[...] 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.