-
Notifications
You must be signed in to change notification settings - Fork 0
List records #8
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
List records #8
Conversation
resumption token logic
| .filter(Metadata.document_id.in_(selected_doc_ids.select()), | ||
| Metadata.is_current == 1 | ||
| ) | ||
| .options(load_only( |
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.
FYI I think that .options can be called later so you can have the same query but with different load_only options.
| def fetch_list(just_ids:bool, start_date :datetime, end_date:datetime, meta_type:MetadataFormat, rq_set:Optional[Union[Group, Archive, Category]], skip: int, query_data: Dict[OAIParams, str])-> Response: | ||
| """fetches the required data for a record for a specific format | ||
| converts data into specific format and renders record template | ||
| """ |
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.
Should start_date and end_date have timezones? not have timezones? are fine with or without?
Add this info to the docstr.
|
|
||
| #resumption token handling | ||
| res_token=None | ||
| if len(objects)>limit: |
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'm concerned here that a query might bring back a very large number of objects and load them into memory.
What is preventing a client from requesting a very large result and then only here it gets limited to smaller set with a resumption token?
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.
the database query is set with .limit(limit+1) so it only retrieves one extra item which is used as a check to see if there are still more
now removes paper with the latest timestamp from list instead of last in list. added tests for chaining resumption tokens. changed dates to rely soley on modtime stamp.
No description provided.