-
Notifications
You must be signed in to change notification settings - Fork 48
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
Proposed changes to search results retrieval api #187
Comments
These changes all seem reasonable to me. Changing max_items = limit is fine, but think we should make sure if using the CLI that it indicates that it only fetched X of numberMatched (if available) Makes sense to not have any function that actually gets all items since a user can do the same thing with an iterator by casting to List. |
I'm 👍🏽 for all proposed solutions (and Matt's amendments) except for that I'm not sure I agree with
. I'm used to |
In that example, the term "Pascal case" (two words, with a space) is being UpperCamelCase stylized to How would you pascal_case the geojson geometries? MultiPolygon to |
Fair. I'll convert to :+0: on the name change, curious if anyone else has thoughts. |
Motivation:
The motivation behind these changes is to provide a better balance in the API between the desire to hide search pagination from a user and the real-world latency in executing these methods.
For example, a user who naively executes this this call:
will be attempting to load 50 million Items into memory. Fortunately this will likely never happen, as they won't wait for all 50,000 sequential requests required to pull them page by page, 1000 at a time.
Proposed Changes:
get_item_collections
toitem_collections
andget_items
toitems
ItemSearch.get_all_items
- this has the potential to consume a large amount of memory, and has no benefit over the iterable get_items method.ItemSearch.get_items_as_dicts() -> Iterable[Dict[str, Any]]
- this will operate the same asget_items()
but will return the (never unmarshalled) dict representation of the Item rather than unmarshalled pydantic Item objectsThe text was updated successfully, but these errors were encountered: