Comments (3)
Sorry about the delayed response here. I missed your initial issue coming in and am just reading this now.
I think one less hacky feeling approach would be to make the paginated call to get the paginator and then modify the limit
parameter which it is using.
That is
paginator = sc.paginated.post_search(index_id, query_data)
paginator.limit = 300
for response in paginator:
...
I'm currently looking at the limit+offset pagination code to see if there are issues with this suggestion, and I believe it will work safely.
For now, that is what I would recommend for this customization.
More broadly, what you're asking about is how to control pagination parameters (rather than the parameters to the paginated call).
I need to think harder about what a good interface looks like. It might be that we need to recognize parameters which are valid for both purposes (like limit
) and "lift" them into the paginator if appropriate, such that a paginated search with limit=300
"just works". But this model needs to work consistently for other pagination modes in order for us to confidently offer that as our interface.
For now, I think building a paginator and then adjusting its attributes is the best way. There are other possibilities for the future, but we'll need to do some analysis to figure out what's best for all cases.
EDIT: sorry, there was a typo in the original code sample I shared.
from globus-sdk-python.
That feels much better, many thanks.
from globus-sdk-python.
I have looked into this further and it seems to me that the limit
keyword is not used in the paginated version of the method. If you look at this line you see that the post_search
method has the paginated
decorator where the page_size=100
. This is used when the client is instantiated to build paginated versions of any routine with this decorator. However your page size is fixed. If I add:
sc.paginated.post_search._paginator_params['page_size'] = 300
just above my post_search
then I get the expected pagination. But this is more of a hack, is there a more canonical method of selecting page size in paginated calls?
from globus-sdk-python.
Related Issues (20)
- Make a user searchable by globus username/email after AuthClient login HOT 2
- Add delete_destination_extra to TransferData documentation
- Feature request: multiple src files transferred to a single dest folder HOT 2
- Support installation with pyinstaller
- automate sharing? HOT 6
- TransferClient.endpoint_manager_task_list has invalid usage as an example
- Update tutorial to indicate how to pass `requested_scopes` and get non-default tokens HOT 5
- Raise the lower bound on `cryptography` in the requirements data
- Note the behavior of tokenstorage adapters on Windows; recommend localappdata
- Paginated methods lose typing information for type-checking HOT 2
- TransferAPIError: Error communicating with Globus Nexus Service HOT 1
- Local endpoint / upload without Globus Personal Connect HOT 3
- Use AuthClient.get_identities() to search by email address? HOT 2
- 403, 'ConsentRequired', 'Missing required data_access consent' HOT 2
- Confusing __str__() implementation for OAuthTokenResponse HOT 1
- Create a LoginManager object which provides a model for managing authentication HOT 1
- Missing f-string in parameterized url HOT 2
- usage Client Credentials Authentication HOT 1
- ConsentRequired error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from globus-sdk-python.