jmespath compile() function raises ParseError when provided JMESPath expression is correct

オープン
#326 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

まず、報告された式を Python の jmespath.compile() で再現し、そのパースを公式の JMESPath ウェブサイトおよび issue で言及されている Rust と Go の実装と比較します。式に対するパーサーの挙動を追跡し、実装が同じ構文を共有しているかどうかを判断します。Python の挙動が誤っている場合、原因を文書化し、回帰テストを追加するか、確認済みの修正を行えば完了です。

索引モデルが issue の本文から書いたものです。

説明

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:

  1. The expression passes successfully when tested on the official JMESPath website.
  2. The same expression compiles without errors in other programming languages such as Rust and Go.
  3. 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.
Screenshot 2024-04-12 135341

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.

主要言語
Python
スター
2.5k
フォーク
231
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jmespath/jmespath.py のほかの issue

jmespath/jmespath.py の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。