Skip to content

Commit

Permalink
Bring back dataset as a required field for BigQuery profile (#1033)
Browse files Browse the repository at this point in the history
In PR #1017, we attempted to remove `dataset` from the required fields
list for the BigQuery profile. However, we realised that this is failing
BiqQuery dbt operations as it indeed is a required field. Hence, bring
back the same as a required field. This is also necessary for building
the mock profile where we construct the profile by taking in
consideration only the required fields.

Closes: #1031
(cherry picked from commit 803776a)
  • Loading branch information
pankajkoti committed Jun 7, 2024
1 parent 7b9e1e6 commit 67071a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cosmos/profiles/bigquery/service_account_keyfile_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ class GoogleCloudServiceAccountDictProfileMapping(BaseProfileMapping):
dbt_profile_type: str = "bigquery"
dbt_profile_method: str = "service-account-json"

# Do not remove dataset as a required field form the below list. Although it's observed that it's not a required
# field for some databases like Postgres, it's required for BigQuery.
required_fields = [
"project",
"dataset",
"keyfile_json",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def test_mock_profile(mock_bigquery_conn_with_dict: Connection):
"type": "bigquery",
"method": "service-account-json",
"project": "mock_value",
"dataset": "mock_value",
"threads": 1,
"keyfile_json": None,
}
Expand Down

0 comments on commit 67071a1

Please sign in to comment.