-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Fix bulk action annotation #50852
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
base: main
Are you sure you want to change the base?
Fix bulk action annotation #50852
Conversation
bf6f3ef
to
22f6aba
Compare
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.
Thanks a lot! Looks good overall! Small question :)
@@ -66,20 +66,29 @@ class BulkBaseAction(StrictBaseModel, Generic[T]): | |||
class BulkCreateAction(BulkBaseAction[T]): | |||
"""Bulk Create entity serializer for request bodies.""" | |||
|
|||
action: BulkAction = Field( |
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.
Should we allow other fields? Maybe it is good to add Literal
here and only allow the action itself to create, upsate, or delete.
What do you think?
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.
It does makes sense to update it with Literal
but I got some type error Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value
when passing enum value to Literal
. Thus, I added type: ignore
for it. Not sure the current version is the best practice or not. Please take another look and let me know if any modification needed, thanks!
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.
CI still have some error, mark it as draft.
22f6aba
to
19a8208
Compare
Why
The type annotations for bulk action are incorrect, which is found when I dig into tracing ci error in #50443. I think this is independent thus split this from that one.
How
I update the action type with default value. This would affect bulk connection, variable and pool.
before (example value show on swagger)
after (example value show on swagger)
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in airflow-core/newsfragments.