Skip to content

Commit

Permalink
Fix test for sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmcalpine committed Nov 24, 2023
1 parent 8d17af8 commit 593c453
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
6 changes: 2 additions & 4 deletions tests/end_to_end_tests/create_test_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@

# Establish connection to production database (if not sqllite)
if datareg.db_connection.dialect != "sqllite":
datareg_prod = DataRegistry(
root_dir=_TEST_ROOT_DIR_PRODUCTION, schema="production"
)
datareg_prod = DataRegistry(root_dir=_TEST_ROOT_DIR_PRODUCTION, schema="production")


def _insert_alias_entry(name, dataset_id):
Expand Down Expand Up @@ -120,7 +118,7 @@ def _insert_dataset_entry(
execution_locale=None,
execution_configuration=None,
input_datasets=[],
input_production_datasets=[]
input_production_datasets=[],
):
"""
Wrapper to create dataset entry
Expand Down
20 changes: 10 additions & 10 deletions tests/end_to_end_tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,19 @@ def test_query_execution():
assert len(results["dependency.input_id"]) == 2, "Bad result from query dep1"

# Query 2: Find production dependencies of an execution
f = datareg.Query.gen_filter("execution.name", "==", "production_id_test")
results = datareg.Query.find_datasets(["execution.execution_id"], [f])
if datareg.Query._dialect != "sqlite":
f = datareg.Query.gen_filter("execution.name", "==", "production_id_test")
results = datareg.Query.find_datasets(["execution.execution_id"], [f])
assert len(results["execution.execution_id"]) == 1, "Bad result from query ex1"

# Find dependencies for this execution
f = datareg.Query.gen_filter(
"dependency.execution_id", "==", results["execution.execution_id"][0]
)
results = datareg.Query.find_datasets(["dependency.input_production_id"], [f])
assert (
len(results["dependency.input_production_id"]) == 1
), "Bad result from query dep2"
# Find dependencies for this execution
f = datareg.Query.gen_filter(
"dependency.execution_id", "==", results["execution.execution_id"][0]
)
results = datareg.Query.find_datasets(["dependency.input_production_id"], [f])
assert (
len(results["dependency.input_production_id"]) == 1
), "Bad result from query dep2"


def test_db_version():
Expand Down

0 comments on commit 593c453

Please sign in to comment.