Skip to content
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

🐛 Fix Rich formatting with no commands #796

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

svlandeg
Copy link
Member

@svlandeg svlandeg commented Apr 9, 2024

When taking the max of the list of commands, define a default value to guard against calling max on an empty list, which would raise an error. (this is also how I had it in the original suggestion)

Fixes PrefectHQ/prefect#12617
Fixes #795

@svlandeg svlandeg added bug Something isn't working p2 labels Apr 9, 2024
@svlandeg svlandeg changed the title Add default when taking max 🐛 Fix Rich formatting with an empty list Apr 9, 2024
Copy link
Member Author

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit test taken from #795 🙏

@svlandeg svlandeg changed the title 🐛 Fix Rich formatting with an empty list 🐛 Fix Rich formatting with no commands Apr 9, 2024
@mattkram
Copy link

mattkram commented Apr 9, 2024

Thanks for the implementation @svlandeg! Beat me to the chase!

@tiangolo tiangolo merged commit 3bc7d25 into fastapi:master Apr 9, 2024
15 checks passed
@tiangolo
Copy link
Member

tiangolo commented Apr 9, 2024

Nice, thank you! @svlandeg 🍰

Sorry I didn't realize we needed the default you had originally suggested. 😬

This will be available in the next minutes in Typer 0.12.3. 🚀

@svlandeg svlandeg deleted the bugfix/max_default branch April 9, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typer 0.12.2 breaks test suite
3 participants