Repository navigation
Conversation
…the page size execute_list advanced the offset by the requested limit. When the server returns fewer entries than requested, because api.maximum_page_limit is lower than the client's limit, the entries in between were never fetched, and a collection smaller than the limit was returned as a single short page. Commands such as pools export, dags list and variables list then silently dropped data. Advance by the number of entries actually received and stop on an empty page.
Eason09053360
left a comment
There was a problem hiding this comment.
Thanks for the patch! Feel free to resolve it.
The guard that returns the first page when the response model has no list field was not exercised by any test, so removing it left the suite green.
Andrushika
left a comment
There was a problem hiding this comment.
Thanks, left few comments
The while loop already stops when the first page is empty or when all entries were received, so the separate check before it is not needed.
Could you please solve it? |
|
Also, we might need to update the PR body. Thanks. |
shahar1
left a comment
There was a problem hiding this comment.
@Rishabh00b Could you please address Andrew's comments and I'll merge afterwards?
There was a problem hiding this comment.
LGTM on the fix itself: advancing by the entries actually received is the right cure for a server-side api.maximum_page_limit cap, and I confirmed locally that all three new tests fail on main and pass with the change (195 tests in test_operations.py green). Two nits below, none blocking. On the open question about the found_key is None guard: every model handed to execute_list today has a list field, so the guard only protects a future caller bug that a TypeError would surface anyway — I'd lean towards dropping it and its test to keep the diff to the bug, but either way is fine by me. For whoever merges: execute_list on airflow-ctl/v0-1-test still has the total_entries < limit early return but none of the total_entries is None handling and wraps validation in a local safe_validate, so the backport-to-airflow-ctl/v0-1-test cherry-pick will conflict and needs a manual backport PR.
Smaller observations
PR description— Only the test count is stale: the body still describes two tests, while the branch has three after the second commit added the no-entries-list guard test (Andrushikaalready asked for the body refresh). Whichever way the guard question goes, the body should match the final set.- See inline comments on
airflow-ctl/tests/airflow_ctl/api/test_operations.py:311. - Please address Andrew's comments.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Airflow handles maintainer review:
Contributing guide.
Co-authored-by: Shahar Epstein <[email protected]>
Backport failed to create: airflow-ctl/v0-1-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 5308480 airflow-ctl/v0-1-testThis should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
|
@henry3260 would appreciate it if you could help backport this to |
Will do thanks 😄 |
…r caps the page size (#76268) (#76414) (cherry picked from commit 5308480) Conflict resolution: this branch validates pages through the local safe_validate/fill_missing_fields helper instead of validate_response, and it has no "total_entries is None" guard because that handling is main-only, so the early return for a short collection is dropped rather than narrowed. Co-authored-by: Rishabh <[email protected]>
…r caps the page size (apache#76268) (apache#76414) (cherry picked from commit 5308480) Conflict resolution: this branch validates pages through the local safe_validate/fill_missing_fields helper instead of validate_response, and it has no "total_entries is None" guard because that handling is main-only, so the early return for a short collection is dropped rather than narrowed. Co-authored-by: Rishabh <[email protected]>
airflowctl's
execute_listmoves to the next page by thelimitit requested. The server may return fewer entries than that whenapi.maximum_page_limitis set lower than the client's limit of 50. In that case the entries between the pages are never fetched, and a result smaller than the limit comes back as one short page. Commands such aspools export,dags listandvariables listthen silently drop data.This advances by the number of entries actually received and stops on an empty page, so a short or empty page can't cause a wrong offset or an endless loop.
Tests: one where the server caps pages at 2 entries while the client asks for 50, and one for an empty page. Both fail without the change.
Was generative AI tooling used to co-author this PR?