Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unchecked multi-value query parameters are sent as a single tuple string

Open Beginner friendly
#123 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
api

Research direction

Start with Query.parameters and _build_url, then inspect VariableQuery.instance_format for the related sequence behavior. Run the regression and control cases using parsed URLs and prepared Requests, followed by the full 148-test suite with VCR record_mode='none'; done means repeated query keys for tuple values while existing list, scalar, pagination, and dedicated-method behavior remains passing.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
29
Forks
32
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nasa/python_cmr

All issues in nasa/python_cmr

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.