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

Improve docs on fix safety for FAST002 #14484

Open
AlexWaygood opened this issue Nov 20, 2024 · 1 comment
Open

Improve docs on fix safety for FAST002 #14484

AlexWaygood opened this issue Nov 20, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@AlexWaygood
Copy link
Member

The fix for FAST002 is marked as always unsafe, but there isn't a ## Fix safety section in the documentation explaining why it is marked as unsafe.

I can think of an obvious reason why the fix might be unsafe on Python 3.8 and lower: the fix adds imports of typing_extensions on Python 3.8 and lower, while the user's code might not have typing_extensions listed as a dependency. However, it's not immediately obvious to me (as a non-expert when it comes to fastAPI) what the exact reasons are for the fix being marked as unsafe on Python 3.9+.

It would be great to add better docs here. Cc. @TomerBin, who implemented the rule in #11579 and @charliermarsh, who merged it.

@TomerBin
Copy link
Contributor

TomerBin commented Nov 20, 2024

At the time it was merged, we weren't handling defaults correctly. If I remember correctly, an improvement was deployed later so we need to check if it's still the case.
This is the relevant fix
#13133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants