Repository navigation
Substitute favorite query args $10 and above - #2449
Merged
Merged
Conversation
prepare_favorite_query_args() replaced "$1" with plain str.replace(), which also matched the start of "$10", "$11" and so on. With ten or more arguments the query was rejected because "$10" was no longer present, and with a single argument "select $1, $10" silently became "select x, x0" instead of reporting the missing "$10". Only match a parameter when it is not followed by another digit.
Contributor
|
Thank you @zzoraemon043 ! |
zzoraemon043
added a commit
to zzoraemon043/zzoraemon043
that referenced
this pull request
Nov 19, 2026
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
Favorite query positional parameters break once a query uses
$10or higher.prepare_favorite_query_args()replaces$1withstr.replace(), so it also rewrites the start of$10,$11, ...The error message is also misleading: the displayed
10is really$1's value followed by0. With fewer arguments the mistake is silent:select $1, $10with one argumentxrunsselect x, x0instead of reporting the missing$10.The fix only matches a parameter when it is not followed by another digit. Single-digit behaviour and the existing error messages are unchanged.
test_subst_favorite_query_args_with_two_digit_parametersfails onmainand passes with this change.pytest mycli_test/pytestshas the same set of failures before and after on my Windows machine (polars/llm/ssh/unix-socket tests that don't run here), plus the new test passing.ruff check,ruff format --checkare clean andmypyreports no new errors.Checklist
changelog.mdfile.mycli/AUTHORS.txtfile (or it's already there).