-
-
Notifications
You must be signed in to change notification settings - Fork 801
👽️ Ensure compatibility with Click 8.3.0 by restoring the original value_is_missing function
#1333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Member
Author
|
This must be related to pallets/click#3030 and using the "UNSET" value... |
value_is_missing function
tiangolo
approved these changes
Sep 19, 2025
Member
tiangolo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick workaround and all the investigation and explanation, great as always! 🙌
I'll release this now in Typer 0.18.0 🚀
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.
Yesterday's release of Click 8.3.0 has introduced a new internal variable
UNSETto differentiate between (truly) unset values and user-providedNonevalues. As a consequence, the methodParameter.value_is_missinginclick.corenow checks for thisUNSETvalue instead of forNone.This results in bugs when using the current Typer with Click 8.3.0+, because a required, unset parameter would be
Nonein Typer (and not the newUNSETvalue) and would eventually get the default value instead of throwing an exception.For instance:
would result in a print
"Hello None"when calling it without any arguments.Potential solutions
value_is_missingfunction to revert it back to its functionality from before 8.3.0. This at least makes the test go green, and allows users to install Click 8.3.0+UNSETvalue. This should also allow us to make different choices with respect to optional flags & flag values, cf 🗑️ Deprecate support foris_flagandflag_valueparameters #987. Maybe with the new functionality in Click, we can restore some of that again. But it would require careful refactoring if we also want to continue support Click 8.2 and lower.Proposal
At this point in time (right before the weekend 🙃) I suggest to merge this PR (option 2), close #1336 (option 1) and continue working on option 3 in the next few weeks.