Repository navigation
FIX Keep repeated query parameters in make_request_and_raise_if_error_async - #3511
Open
Shivam Sharma (ShivamSharma43) wants to merge 1 commit into
Open
Shivam Sharma (ShivamSharma43) wants to merge 1 commit into
Shivam Sharma (ShivamSharma43) wants to merge 1 commit into
Conversation
…_async The endpoint URL's query was flattened to a dict with one value per key, so "?tag=a&tag=b" was sent as "?tag=a". Parse the query into (key, value) pairs instead, so every value is sent, and let a key in extra_url_parameters replace all of that key's URL values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Richard Lundeen (richlundeen)
approved these changes
Oct 25, 2026
Richard Lundeen (richlundeen)
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Keeping query parameters as pairs preserves repeated values, and explicit extra parameters still replace all URL values for the same key.
Reviewed with GitHub Copilot.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3510.
make_request_and_raise_if_error_asyncread the endpoint URL's query withextract_url_parameters, which flattens it to adict[str, str]with the first value of each key. So?tag=a&tag=bwas sent as?tag=a, with or withoutextra_url_parameters.Changes:
parse_qsl(..., keep_blank_values=True)into(key, value)pairs and passed to httpx as a tuple of pairs, so every value is sent. Blank values are still kept (Preserve empty URL query parameters #1494).extra_url_parametersstill takes precedence: it replaces all of that key's values from the URL, and the other keys are appended as before.URLs without repeated keys are sent the same way as before.
extract_url_parametersitself is unchanged.Tests and Documentation
tests/unit/common/test_common_net_utility.py: repeated keys with no extra parameters, with an extra parameter added, with an extra parameter replacing another key, and with an extra parameter replacing a repeated key. It checks the URL that is actually sent.mainthe first three cases fail (onlytag=ais sent); the fourth passes on both and pins that an extra parameter replaces every URL value of its key.pytest tests/unit/commonplus the callers' tests (test_figstep_dataset.py,test_image_cache.py,test_msts_dataset.py,test_azure_ml_chat_target.py,test_hack_a_prompt_target.py,test_prompt_shield_target.py): 786 passed.ruff check,ruff formatandty checkpass on the changed files.🤖 Generated with Claude Code