-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
AIP-81 Add Insert Multiple Pools API #44121
AIP-81 Add Insert Multiple Pools API #44121
Conversation
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.
Nice thanks
9fa560e
to
42e8a51
Compare
Looks good! Thanks for the changes @jason810496! I believe the CI failure is likely a transient error caused by a DNS issue that couldn’t resolve AWS S3 at that moment. |
just reran. seems to work fine 👀 |
42e8a51
to
1ec682f
Compare
Just resolved the issue with inserting duplicate pools by handling the database exception rather than adding extra logic to the |
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.
Looking good, one minor nit, we can merge then.
That would be great. You can create an issue to track that if you're not going to work on it directly just so we do not forget about it. If you plan on tackling that right away, no need to create an issue opening a PR is perfectly fine. |
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.
maybe this is not the best approach
bde6004
to
510e373
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.
Really nice. I like the exception handler class approach (private classes, only expose array of handlers), and the factory pattern for registering the handlers, good idea.
A couple of nitpicks, ready to merge after that.
- handle exception from db level instead of application level
510e373
to
c9b67c1
Compare
Just fixed the nit. I will refactor all endpoints to adopt the global error handler for managing unique constraint violation errors in further PR. |
Nice. 🎉 What is great about that is the |
closes: #43896
related: #43657
Fix: Add
max_length=256
forPoolPostBody.pool
The model defined in https://github.com/apache/airflow/blob/main/airflow/models/pool.py#L54 enforces a string length constraint on
Pool.pool
. To maintain consistency, this constraint should also be validated at the router level.Refactor: Handle Duplicate Cases in
Insert Pool
The
Insert Pool
(single insert) functionality should account for cases where a duplicate pool name is provided, asPool.pool
is defined with aunique
constraint.Feat: Add Insert Multiple Pools API
A new API endpoint for inserting multiple pools has been introduced as
/pools/bulk
. Alternative names such as/pools/batch
or/pools/multiple
were considered. Feedback on which name best describes the endpoint is welcome.