Skip to content

Commit

Permalink
Automatically create empty collection when trying to retrieve non-exi…
Browse files Browse the repository at this point in the history
…sting collection
  • Loading branch information
GJFR committed Nov 13, 2024
1 parent 2a34025 commit f6e34cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bci/database/mongo/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def has_result(self, params: TestParameters) -> bool:
def get_evaluated_states(
self, params: EvaluationParameters, boundary_states: tuple[State, State], outcome_checker: OutcomeChecker
) -> list[State]:
collection = self.get_collection(params.database_collection)
collection = self.get_collection(params.database_collection, create_if_not_found=True)
query = {
'browser_config': params.browser_configuration.browser_setting,
'mech_group': params.evaluation_range.mech_group,
Expand Down Expand Up @@ -308,7 +308,7 @@ def get_build_id_firefox(self, state: State):
return result['build_id']

def get_documents_for_plotting(self, params: PlotParameters, releases: bool = False):
collection = self.get_collection(params.database_collection)
collection = self.get_collection(params.database_collection, create_if_not_found=True)
query = {
'mech_group': params.mech_group,
'browser_config': params.browser_config,
Expand Down

0 comments on commit f6e34cc

Please sign in to comment.