Skip to content

Commit

Permalink
Disable pk-dependent functionality for BigQuery. (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
kklein authored Jan 17, 2023
1 parent c85d583 commit 675043a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/datajudge/constraints/miscs.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def __init__(

def test(self, engine: sa.engine.Engine) -> TestResult:

if self.infer_pk_columns and db_access.is_bigquery(engine):
raise NotImplementedError("No primary key concept in BigQuery")

# only check for primary keys when actually defined
# otherwise default back to searching the whole table
if self.infer_pk_columns and (
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,8 @@ def test_uniqueness_within(engine, mix_table2, data):
],
)
def test_uniqueness_within_infer_pk(engine, data, mix_table2_pk):
if is_bigquery(engine):
pytest.skip("No primary key concept in BigQuery")
# We purposefully select a non-unique column ["col_date"] to validate
# that the reference columns are overwritten.
operation, target_columns, selection_columns = data
Expand Down

0 comments on commit 675043a

Please sign in to comment.