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: Cypher query extraction for node names with spaces #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chkaty
Copy link

@chkaty chkaty commented Dec 18, 2024

Description:

This PR fixes an issue in GraphCypherQAChain where node labels containing spaces (e.g., "Medical Condition") resulted in a Neo.ClientError.Statement.SyntaxError when generating Cypher queries. The issue was caused by node names with spaces not being wrapped in quotes, which are required for correct Cypher syntax.

Modified the extract_cypher function to wrap node names containing spaces in backticks.

Issue:

Fixes #28375

Dependencies:

N/A

Test Coverage:

Unit tests have been added to ensure that node names with single and multiple spaces are correctly wrapped in backticks.
Queries with already backtick-wrapped node names remain unaffected.

Lint and Test:

Ran make format, make lint, and make test to ensure all tests pass and the code adheres to the formatting standards.

- Updated `extract_cypher` to wrap node label with spaces in quotes.
- Added tests for node names with one and multiple spaces.
- Renamed test cases to improve clarity.
- Checked lint and format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant