-
-
Notifications
You must be signed in to change notification settings - Fork 17
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 annotated default detection #856
Conversation
243cd5c
to
54648da
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #856 +/- ##
=======================================
Coverage 72.19% 72.19%
=======================================
Files 27 27
Lines 2093 2093
Branches 643 643
=======================================
Hits 1511 1511
Misses 276 276
Partials 306 306 ☔ View full report in Codecov by Sentry. |
Qodana Community for PythonIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2023.3.0
with:
upload-result: true Contact Qodana teamContact us at qodana-support@jetbrains.com
|
dd48915
to
39186ce
Compare
39186ce
to
af3a462
Compare
klm: Annotated[str, Info(), Field(default_factory=lambda: 456)] | ||
nop: Annotated[str, Field(default_factory=lambda: 789), Info()] |
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.
@koxudaxi just a quick question, i see that this is tested only with default_factory
. is there a reason for not also having a test case with default
? (that's the flavor of error I had run into with this)
thanks regardless! :)
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.
@Tshimanga
I expect only default_factory
. because, pydantic v1 don't allow default
in the annotated Field.
But, Pydantic V2 doesn't say any error. I will fix it in another PR.
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!!
Fixes: #731