Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HJ-116 - Fix BigQuery partitioning queries to properly support multiple identity clauses #5432

Merged
merged 18 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fides/api/service/connectors/query_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ def get_formatted_query_string(
Returns a query string with backtick formatting for tables that have the same names as
BigQuery reserved words.
"""
return f'SELECT {field_list} FROM `{self._generate_table_name()}` WHERE {" OR ".join(clauses)}'
return f'SELECT {field_list} FROM `{self._generate_table_name()}` WHERE ({" OR ".join(clauses)})'

def generate_masking_stmt(
self,
Expand Down
1 change: 0 additions & 1 deletion tests/ops/service/connectors/test_bigquery_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from fides.api.service.connectors.sql_connector import BigQueryConnector


@pytest.mark.skip(reason="move to plus in progress")
@pytest.mark.integration_external
@pytest.mark.integration_bigquery
class TestBigQueryConnector:
Expand Down
7 changes: 3 additions & 4 deletions tests/ops/service/connectors/test_queryconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,6 @@ def test_query_to_str(self, complete_execution_node):
assert query_to_str == "SELECT name FROM users WHERE email = 'test@example.com'"


@pytest.mark.skip(reason="move to plus in progress")
@pytest.mark.integration_external
@pytest.mark.integration_bigquery
class TestBigQueryQueryConfig:
Expand Down Expand Up @@ -1026,16 +1025,16 @@ def execution_node(
BigQueryNamespaceMeta(
project_id="cool_project", dataset_id="first_dataset"
),
"SELECT address_id, created, email, id, name FROM `cool_project.first_dataset.customer` WHERE email = :email",
"SELECT address_id, created, email, id, name FROM `cool_project.first_dataset.customer` WHERE (email = :email)",
),
# Namespace meta will be a dict / JSON when retrieved from the DB
(
{"project_id": "cool_project", "dataset_id": "first_dataset"},
"SELECT address_id, created, email, id, name FROM `cool_project.first_dataset.customer` WHERE email = :email",
"SELECT address_id, created, email, id, name FROM `cool_project.first_dataset.customer` WHERE (email = :email)",
),
(
None,
"SELECT address_id, created, email, id, name FROM `customer` WHERE email = :email",
"SELECT address_id, created, email, id, name FROM `customer` WHERE (email = :email)",
),
],
)
Expand Down