When using the compile() function in JMESPath with a correct expression, a ParseError is raised unexpectedly.
Issue Details:
-
Input JSON data:
{ "name": "John", "last_name": "Doe" }
-
JMESPath expression:
join('', ['Name : 'name,' ' 'Last Name : 'last_name])
-
Error message:
jmespath.exceptions.ParseError: Expecting: comma, got: unquoted_identifier: Parse error at column 19, token "name" (UNQUOTED_IDENTIFIER), for expression: "join('', ['Name : 'name,' ' 'Last Name : 'last_name])
This issue is unexpected for the following reasons:
- The expression passes successfully when tested on the official JMESPath website.
- The same expression compiles without errors in other programming languages such as Rust and Go.
- The issue persists across different versions of the JMESPath module in Python, including the latest version.
Additional information:
Attaching an image demonstrating the successful execution of the expression on the official JMESPath website for reference.

The compile() function should not raise a ParseError for the provided JMESPath expression, as it is syntactically correct and passes successfully in other contexts.
Any suggestions on how to proceed with resolving this issue are highly welcomed.
When using the compile() function in JMESPath with a correct expression, a ParseError is raised unexpectedly.
Issue Details:
Input JSON data:
{ "name": "John", "last_name": "Doe" }JMESPath expression:
join('', ['Name : 'name,' ' 'Last Name : 'last_name])Error message:
jmespath.exceptions.ParseError: Expecting: comma, got: unquoted_identifier: Parse error at column 19, token "name" (UNQUOTED_IDENTIFIER), for expression: "join('', ['Name : 'name,' ' 'Last Name : 'last_name])This issue is unexpected for the following reasons:
Additional information:

Attaching an image demonstrating the successful execution of the expression on the official JMESPath website for reference.
The compile() function should not raise a ParseError for the provided JMESPath expression, as it is syntactically correct and passes successfully in other contexts.
Any suggestions on how to proceed with resolving this issue are highly welcomed.