You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Perform a bulk insert of items into the database synchronously.
Args:
self: The instance of the object calling this function.
collection_id (str): The ID of the collection to which the items belong.
processed_items (List[Item]): A list of `Item` objects to be inserted into the database.
refresh (bool): Whether to refresh the index after the bulk insert (default: False).
Notes:
This function performs a bulk insert of `processed_items` into the database using the specified `collection_id`. The
insert is performed synchronously and blocking, meaning that the function does not return until the insert has
completed. The `mk_actions` function is called to generate a list of actions for the bulk insert. If `refresh` is set to
True, the index is refreshed after the bulk insert. The function does not return any value.
"""
helpers.bulk(
self.sync_client,
mk_actions(collection_id, processed_items),
refresh=refresh,
raise_on_error=False,
)
The bulk methods set raise_on_error=False but then ignore the returned errors, making these methods unsafe to use in production environment. If you don't want to deal with the errors, let them raise so it's possible to handle it in the client code.
The text was updated successfully, but these errors were encountered:
Zaczero
changed the title
bulk_async ignores errors and can cause missing data
bulk_* ignores errors and can cause missing data
Mar 30, 2025
stac-fastapi-elasticsearch-opensearch/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py
Lines 1075 to 1121 in b016945
The bulk methods set raise_on_error=False but then ignore the returned errors, making these methods unsafe to use in production environment. If you don't want to deal with the errors, let them raise so it's possible to handle it in the client code.
The text was updated successfully, but these errors were encountered: