Unchecked multi-value query parameters are sent as a single tuple string
評価
調査の方向性
Query.parameters と _build_url から始め、関連するシーケンス動作について VariableQuery.instance_format を調べます。解析済みの URL と準備済みの Requests を使用して回帰ケースとコントロールケースを実行し、その後 VCR record_mode='none' で完全な 148 テストスイートを実行します。タプル値に対するクエリキーの繰り返しが機能し、既存のリスト、スカラー、ページネーション、専用メソッドの動作が引き続きパスすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Reproduction
On develop at 9f7648ccb925b9c0eb50241e35f15d6454e89505, the unchecked multi-value path in Query.parameters stores a tuple under a key ending in [], but _build_url only expands lists.
from cmr import CollectionQuery
query = CollectionQuery().parameters(data_center=["FIRST", "SECOND"])
print(query._build_url())
The query string is data_center[]=('FIRST', 'SECOND'). It should be data_center[]=FIRST&data_center[]=SECOND. Singleton and empty iterables are also serialized as tuple representations. The same base-class behavior affects every query type and reaches requests made by results, get, and hits.
VariableQuery.instance_format also accepts sequences, but a tuple argument has the same problem without the existing array suffix.
Expected behavior
Expand both list and tuple parameter values into repeated query keys, without adding a second [] to keys that already have one. Keep the existing stored parameter representation, dedicated-method tuple unpacking, scalar handling, and pagination behavior.
Nineteen new regression/control cases use parsed URLs and real Requests prepared requests with only the transport replaced. Seventeen fail on unchanged code, while the existing list/scalar controls pass. The focused fix passes all 148 tests, with existing VCR cassettes replayed in record_mode='none' so no live CMR requests are made.
- 主要言語
- Python
- スター
- 29
- フォーク
- 35
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nasa/python_cmr のほかの issue
-
Tool, service and variable get requests omit configured headers対応中かも @sylvesterkaczmarek が 14 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nasa/python_cmr#122 ·
-
very small numbers get written into URLs with error-raising scientific notation対応中かも @arpitjain099 が 115 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nasa/python_cmr#108 ·
-
additional attributes対応中かも @Hashim1999164 が 57 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
nasa/python_cmr#104 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
nasa/python_cmr#95 · コメント 1 件 ·
-
Return parsed items in results for all umm_json* formats対応中かも @Shubham-Padkonde が 8 日前に担当しました。 オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
nasa/python_cmr#94 ·
nasa/python_cmr の issue をすべて見る
似ている issue
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hatchet-dev/hatchet#5179 ·
メンテナーはふだん 1 日以内に返信
-
python-version
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
bug javascript P2-medium python release:v3.1
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
adrirubio/claude-deck#546 ·
メンテナーはふだん 1 日以内に返信