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

Feature Request: Support double dot param names #66

Open
B-Stefan opened this issue Dec 28, 2019 · 7 comments · May be fixed by RedisGraph/RedisGraph#2093
Open

Feature Request: Support double dot param names #66

B-Stefan opened this issue Dec 28, 2019 · 7 comments · May be fixed by RedisGraph/RedisGraph#2093

Comments

@B-Stefan
Copy link

B-Stefan commented Dec 28, 2019

Thanks for all the work on this project!

I tried to integrate RedisGraph into an existing project(prov-db-connector) and got an unexpected error:

The following command with params will cause an exception because the param name contains and :

Example to reproduce

 params = {'prefix:purpose': "pleasure"}
 query = """MATCH (p:person)-[v:visited {purpose:$purpose}]->(c:country)
                   RETURN p.name, p.age, v.purpose, c.name"""
result = graph.query(query, params)

The code above produces the following query and exception

Exception

social CYPHER prefix:purpose="pleasure" MATCH (p:person)-[v:visited {purpose:$purpose}]->(c:country)
        		   RETURN p.name, p.age, v.purpose, c.name
redis.exceptions.ResponseError: errMsg: Invalid input ':': expected '=' line: 1, column: 14, offset: 13 errCtx: CYPHER prefix:purpose="pleasure" MATCH (p:person)-[v:visited {purpose:$purpos... errCtxOffset: 13

Expected behavior

The example above should be saved successfully to Redis

Potential solution

The library should escape/encode params and queries.

What do you think about this issue? If you need any help to reproduce or investigate this issue, please let me know!

@swilly22
Copy link
Contributor

Generally speaking including : within the parameter name is a bit confusing
as a parameter is defined as a key : value pair.
Assuming setting the parameter works, how would you refer to it?
RETURN $prefix:purpose probably won't work,
This is what I'm getting from Neo4j:

RETURN $prefix:purpose
Neo.ClientError.Statement.ParameterMissing
Expected parameter(s): prefix

@B-Stefan
Copy link
Author

Yeah, I agree, it is not best-practice but still allowed to address via ``.
Example query I wrote 2 years ago:

MATCH (x {`meta:identifier`: 'some'})-[r *1]-(y)

@B-Stefan
Copy link
Author

B-Stefan commented Dec 6, 2020

Just want to ask if this issue is still open or do you think a new evaluation would be promising due to a complete rewrite/improvement of the library during the last year?

@swilly22
Copy link
Contributor

swilly22 commented Dec 7, 2020

Sorry @B-Stefan this issue is still open, I'm able to create an attribute with : in its name but was unable to define a parameter with : in its name.

@B-Stefan
Copy link
Author

B-Stefan commented Jan 6, 2022

Happy new year to everybody. I just revisited an open issue on the prov-db-connector, and I want to ask if this issue is still open or resolved in a release of redisgraph-py?

@swilly22
Copy link
Contributor

swilly22 commented Jan 7, 2022

Hi, I believe the issue is still open, @jeffreylovitz would you mind taking a look ?

@jeffreylovitz
Copy link
Contributor

Hi @B-Stefan,

This is a parser-level issue, rather than being scoped to redisgraph-py.

I've written a fix, and we should be able to merge it into the master branch within a few days!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants