Skip to content

Logical expressions and non-singular filter queries #45

@jg-rp

Description

@jg-rp

We are erroneously raising a JSONPathSyntaxError when non-singular filter queries appear in logical expressions.

Example:

import jsonpath

data = [
  {
    "a": "b",
    "d": "e"
  },
  {
    "b": "c",
    "d": "f"
  }
]

query = "$[?@..* && @.b]"
jsonpath.findall(query, data)
# JSONPathSyntaxError: non-singular query is not comparable, line 1, column 8

This would be the correct behaviour in a comparison expression, as non-singular queries can not be compared, but we are applying the same logic to logical expressions, which is bad.

Metadata

Metadata

Assignees

No one assigned

    Labels

    JSONPathbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions