Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed Dec 7, 2023
1 parent 0044f5b commit aed7677
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion aleph/logic/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def index_many(stage, collection, sync=False, entity_ids=None, batch=BATCH_SIZE)
refresh_collection(collection.id)


def bulk_write(collection, entities, safe=False, role_id=None, mutable=True, clean=True):
def bulk_write(
collection, entities, safe=False, role_id=None, mutable=True, clean=True
):
"""Write a set of entities - given as dicts - to the index."""
# This is called mainly by the /api/2/collections/X/_bulk API.
aggregator = get_aggregator(collection)
Expand Down
7 changes: 6 additions & 1 deletion aleph/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ def read_entities():

role = Role.load_cli_user()
for _ in bulk_write(
collection, read_entities(), safe=safe, mutable=mutable, clean=clean, role_id=role.id
collection,
read_entities(),
safe=safe,
mutable=mutable,
clean=clean,
role_id=role.id,
):
pass
reindex_collection(collection)
Expand Down
7 changes: 6 additions & 1 deletion aleph/views/collections_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,12 @@ def bulk(collection_id):
entities = ensure_list(request.get_json(force=True))
entity_ids = list()
for entity_id in bulk_write(
collection, entities, safe=safe, mutable=mutable, clean=clean, role_id=request.authz.id
collection,
entities,
safe=safe,
mutable=mutable,
clean=clean,
role_id=request.authz.id,
):
entity_ids.append(entity_id)
if entityset is not None:
Expand Down

0 comments on commit aed7677

Please sign in to comment.