Skip to content

[BUG] Query params with escaped single quotes cannot be parsed #733

Open
@danielfinke

Description

@danielfinke

Community Note

  • Please use a 👍 reaction to provide a +1/vote. This helps the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Describe the bug
When using Python as query parameter inputs, single quotes in input strings cannot be parsed and are considered "invalid JSON".

  • OS: macOS 15.4
  • Browser: Google Chrome 135.0.7049.85
  • Graph Notebook Version: 4.6.2
  • Graph Database & Version: Amazon Neptune 1.4.4.0

To Reproduce
Steps to reproduce the behavior:

  1. Create a notebook cell with the following input:
params = {
    'inputs': [{ 'text': 'I\'m a string with \'single quotes\'' }]
}
  1. Create an openCypher cell using those params:
%%oc -qp params
UNWIND $inputs AS input
RETURN input.text
  1. See error:
{
  "code": "MalformedQueryException",
  "requestId": "<requestId>",
  "detailedMessage": "Supplied 'parameters' cannot be parsed: invalid JSON",
  "message": "Supplied 'parameters' cannot be parsed: invalid JSON"
}
  1. Remove the escaped single quotes from the input and observe the error goes away.

The error is also present for unescaped single quotes within a double-quoted Python string.

Expected behavior
The string with escaped single quotes is returned by the openCypher query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions