-
Notifications
You must be signed in to change notification settings - Fork 471
feat: support pagination in list_* methods in rest catalog
#2158
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
Closed
jayceslesar
wants to merge
7
commits into
apache:main
from
jayceslesar:feat/rest-catalog-pagination-v2
Closed
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d1711d5
feat: support pagination in list_* methods in rest catalog
jayceslesar a7a224c
add tests, fix missing params
jayceslesar 95e9024
remove dangling retry decorator
jayceslesar ca035a1
backwards compat
jayceslesar 61d4f2b
Merge branch 'main' into feat/rest-catalog-pagination-v2
jayceslesar 96da05b
Iterators all the way down
jayceslesar bc35038
Merge branch 'main' into feat/rest-catalog-pagination-v2
jayceslesar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ideally, we want to return a special
Iterable[Identifier]that calls the next page when the current page is exhausted. This avoids pulling in all theIdentifiers right away, reducing memory pressure.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.
makes sense, I think I can implement something. That will be a breaking change though right?
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.
Added an
iter_*method for each listable and opted to just call list(iter) in the existing list_* methods to avoid a breaking change -- If you have suggestions/guidance on how to accomplish both without making a breaking change I will happily implement as that would be much better but I didn't see an obvious way to do itThere 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.
Yes, it will be partially breaking, but
Iterableis pretty close toList, so I think the community might be okay with the change.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.
Is swapping to
Iterablewhat we want to do then? It makes the rest catalog break the interface as every other catalog returns lists -- so would need to change every other catalog to also return anIterablein the type signatureThere 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.
Overnight, I was thinking that maybe we could subclass
List?Otherwise, switching to the
Iterablemakes the most sense to me. We can also split out the change in a separate PR and send out an email to the devlist to see what others 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.
Agreed on switching to iterable, subclassing list seems sort of like a lot just to support pagination. I will have a commit that makes all list responses from catalogs iterables later...fighting one issue with click and how it handles the context but other than that all tests are passing with that swap
Uh oh!
There was an error while loading. Please reload this page.
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.
ok, all iterators now -- seriously would have been impossible without the test coverage we have
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.
I dont think its even worth making a separate issue with just the iterator change as we will still have to modify the list_* methods in the rest catalog due to that retry decorator to essentially be wrappers around a similar list_raw call. Should I just send this PR to the dev list to get some more eyes on it?
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.
#2172