-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add pagination to SimpleHttpOperator #34606
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
Add pagination to SimpleHttpOperator #34606
Conversation
59c8090 to
e310b31
Compare
|
Thanks for the contribution! I was not aware of cases where pagination is used until I saw this PR. I don't know how common this is in API Calls and might be very specific. Also - to be open - I am not sure whether such function is so common that it makes sense to add it into the code package. I believe (but this is my personal opinion - other opinions welcome!) that this could also be very good placed in a contributor package to keep the basic operator "simple". Python is extensible and the standard operator can easily be used and extended per customer project. (I am not a committer so my opinion only counts a bit, would be good to get other maintainers opinion on this contribution - also if not in code where such extension could be best placed in.) |
cdf155e to
96f9985
Compare
|
From his name I see that it should be simple and just used to execute actions and not load big payloads which need pagination. IMHO creating a new operator is better for this feature, and try to keep it generic, like |
|
Alright, thanks for reviews ! I'll create a new PR with a Paginated one, based on the HttpOperator |
Hello,
This PR implements support for paginated API in the
SimpleHttpOperator. No breaking changes, but adds a lot of code into this Operator. I can also propose a PR with a new PaginatedHttpOperator if better ?Use case:
I have been facing a very specific use-case where the API:
Dynamic Tasks? It works like a for loop. In this case, knowing in advance the number of pages means calling the API two times. Which is inefficient, and do not guarantee all pages are traversed during the second call.
^ 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.rstor{issue_number}.significant.rst, in newsfragments.