EricAraujoBsB opened a new pull request, #40877: URL: https://github.com/apache/superset/pull/40877
### SUMMARY This PR fixes `modify_url_query` so repeated query parameters are preserved when updating or adding URL parameters. Previously, `modify_url_query` parsed query parameters into lists using `parse_qs`, but rebuilt the query string manually by taking only the first value of each parameter. As a result, URLs containing repeated parameters such as: ```text /explore/?filter=a&filter=b ``` could be incorrectly serialized as: ```text /explore/?filter=a ``` This change replaces the manual query string serialization with `urllib.parse.urlencode(..., doseq=True)`, allowing multiple values for the same query parameter to be correctly expanded and preserved. The implementation also keeps the existing URL encoding behavior by using `quote_via=urllib.parse.quote` and `safe="/"`, ensuring spaces are encoded as `%20` and path-like values containing `/` remain readable. Additional unit tests were added to cover: * preserving repeated query parameters already present in the URL; * adding list values as repeated query parameters; * maintaining existing behavior for scalar query parameter replacement. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> * [ ] Has associated issue: * [ ] Required feature flags: * [ ] Changes UI * [ ] Includes DB Migration (follow approval process in [[SIP-59](https://github.com/apache/superset/issues/13351)](https://github.com/apache/superset/issues/13351)) * [ ] Migration is atomic, supports rollback & is backwards-compatible * [ ] Confirm DB migration upgrade and downgrade tested * [ ] Runtime estimates and downtime expectations provided * [ ] Introduces new feature or API * [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
