Skip to content

Logical expressions and non-singular filter queries #45

Closed

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.

Activity

  1. added
    bug
    on Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    JSONPathbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions