🐛 Fix shell_complete not working for Arguments#737
Merged
tiangolo merged 13 commits intofastapi:masterfrom Aug 16, 2024
bckohan:master
Merged
🐛 Fix shell_complete not working for Arguments#737tiangolo merged 13 commits intofastapi:masterfrom bckohan:master
shell_complete not working for Arguments#737tiangolo merged 13 commits intofastapi:masterfrom
bckohan:master
Conversation
dbosk
reviewed
Feb 8, 2024
dbosk
left a comment
There was a problem hiding this comment.
I think we need get_param_completion to be able to skip some of the parameters for the shell_complete function, such as shell_complete(incomplete: str).
7 tasks
svlandeg
approved these changes
Apr 19, 2024
Member
svlandeg
left a comment
There was a problem hiding this comment.
Nice catch! The one line fix seems correct to me, and I can confirm that it fixes the bug that was reported earlier in #334.
Thanks for adding a test! I just moved it out of compat and into test_others.py where there were a few other completion tests as well. Not sure if this is where Tiangolo wants it or someplace else 😇
shell_complete not working for Arguments
Member
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.
As pointed out in #334 the shell_complete parameter on Arguments is not called. This is a very simple bug where shell_complete was simply omitted as a parameter passed to TyperArgument.
This PR adds the missing parameter resulting in a one line change in the library and it adds one additional completion test that tests that shell_complete works as expected when given to an Argument.