Fix REST API pools: serialize unlimited open_slots as -1 instead of inf#65466
Conversation
henry3260
left a comment
There was a problem hiding this comment.
Overall looks great! Just a small nit
henry3260
left a comment
There was a problem hiding this comment.
Looks good, just waiting for a maintainer's review.
|
CI need fixing. |
|
@pierrejeambrun — CI didn't auto-trigger on the latest commit. Could you rerun? |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Apparently CI still needs fixing. You can take a look at our contribution documentation to see how to run those check locally.
Hi @pierrejeambrun — I dug into the three failing jobs on commit 41395ab and they all appear to be pre-existing on v2-11-stable, not caused by this PR (which only modifies airflow/api_connexion/schemas/pool_schema.py +15/-3 and tests/api_connexion/schemas/test_pool_schemas.py +22/-3). Concretely:
The static-checks job (which originally was the only one failing because of my code) is now green after 41395ab. Could you confirm whether the three remaining failures need a separate branch fix, or whether they can be ignored for this PR? Happy to follow up if any of them turns out to be related to my change. |
|
@shan-zeeshan786 Converting to draft — this PR doesn't yet meet our Pull Request quality criteria.
See the linked criteria for how to fix each item, then mark the PR "Ready for review". This is not a rejection — just an invitation to bring the PR up to standard. No rush. Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you. |
pierrejeambrun
left a comment
There was a problem hiding this comment.
I believe that only the static failure was caused by this PR.
I just restarted the CI lets see 🤞, should be good.
|
Updated the target branch from Let's see what happens now. |
41395ab to
ed03dec
Compare
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
|
Thanks @pierrejeambrun , i will take care of your points. |
For pools with unlimited capacity (slots == -1), Pool.open_slots() returns float("inf"). The Connexion v1 REST API schema defines open_slots as an integer, so the serialized response failed OpenAPI validation and clients saw HTTP 500 with a message that inf is not an integer.
This change updates PoolSchema.get_open_slots so unlimited pools expose open_slots as -1, aligned with how unlimited capacity is already represented via slots: -1. A regression test ensures serialization never emits inf for such pools.
Files changed
Related issue
close: #65377