2626from stac_fastapi .elasticsearch .session import Session
2727from stac_fastapi .extensions .third_party .bulk_transactions import (
2828 BaseBulkTransactionsClient ,
29- Items , BulkTransactionMethod ,
29+ BulkTransactionMethod ,
30+ Items ,
3031)
3132from stac_fastapi .types import stac as stac_types
3233from stac_fastapi .types .config import Settings
@@ -718,7 +719,9 @@ def __attrs_post_init__(self):
718719 settings = ElasticsearchSettings ()
719720 self .client = settings .create_client
720721
721- def preprocess_item (self , item : stac_types .Item , base_url , method : BulkTransactionMethod ) -> stac_types .Item :
722+ def preprocess_item (
723+ self , item : stac_types .Item , base_url , method : BulkTransactionMethod
724+ ) -> stac_types .Item :
722725 """Preprocess an item to match the data model.
723726
724727 Args:
@@ -729,8 +732,10 @@ def preprocess_item(self, item: stac_types.Item, base_url, method: BulkTransacti
729732 Returns:
730733 The preprocessed item.
731734 """
732- exist_ok = (method == BulkTransactionMethod .UPSERT )
733- return self .database .sync_prep_create_item (item = item , base_url = base_url , exist_ok = exist_ok )
735+ exist_ok = method == BulkTransactionMethod .UPSERT
736+ return self .database .sync_prep_create_item (
737+ item = item , base_url = base_url , exist_ok = exist_ok
738+ )
734739
735740 @overrides
736741 def bulk_item_insert (
@@ -753,7 +758,8 @@ def bulk_item_insert(
753758 base_url = ""
754759
755760 processed_items = [
756- self .preprocess_item (item , base_url , items .method ) for item in items .items .values ()
761+ self .preprocess_item (item , base_url , items .method )
762+ for item in items .items .values ()
757763 ]
758764
759765 # not a great way to get the collection_id-- should be part of the method signature
0 commit comments