Skip to content

Commit

Permalink
Fix silly mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
haiqi96 committed Nov 18, 2024
1 parent 7a3398f commit 1d1599e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def is_stream_extraction_active(self) -> bool:
return self.__file_split_id in active_file_split_ir_extractions

def is_stream_extracted(self, results_cache_uri: str, stream_collection_name: str) -> bool:
return document_exist(
return document_exists(
results_cache_uri, stream_collection_name, "file_split_id", self.__file_split_id
)

Expand Down Expand Up @@ -159,7 +159,7 @@ def is_stream_extraction_active(self) -> bool:
return self._archive_id in active_archive_json_extractions

def is_stream_extracted(self, results_cache_uri: str, stream_collection_name: str) -> bool:
return document_exist(
return document_exists(
results_cache_uri, stream_collection_name, "orig_file_id", self._archive_id
)

Expand All @@ -179,7 +179,7 @@ def create_stream_extraction_job(self) -> QueryJob:
)


def document_exist(mongodb_uri, collection_name, field, value):
def document_exists(mongodb_uri, collection_name, field, value):
with pymongo.MongoClient(mongodb_uri) as mongo_client:
collection = mongo_client.get_default_database()[collection_name]
return 0 != collection.count_documents({field: value})
Expand Down Expand Up @@ -448,7 +448,7 @@ def get_archive_and_file_split_ids(
return results


@exception_default_value(default=[])
@exception_default_value(default=False)
def archive_exists(
db_conn,
archive_id: str,
Expand Down

0 comments on commit 1d1599e

Please sign in to comment.