-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into test_various_snapshot_configs
- Loading branch information
Showing
39 changed files
with
1,049 additions
and
964 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Breaking Changes | ||
body: Drop support for Python 3.8 | ||
time: 2024-10-16T18:51:17.581547-04:00 | ||
custom: | ||
Author: mikealfare | ||
Issue: "1373" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: "Dependencies" | ||
body: "Update wheel requirement from ~=0.42 to ~=0.43" | ||
time: 2024-07-24T04:07:44.00000Z | ||
custom: | ||
Author: dependabot[bot] | ||
PR: 1304 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: add is_retryable test case when raise ServiceUnavailable | ||
time: 2024-05-05T01:18:38.737882+09:00 | ||
custom: | ||
Author: jx2lee | ||
Issue: "682" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Adds the ability to set optional `quota_project` in profile | ||
time: 2024-09-11T23:48:59.767649+01:00 | ||
custom: | ||
Author: jcarpenter12 | ||
Issue: 1343 1344 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: use "direct" write for non-partitioned python model materializations | ||
time: 2024-10-28T17:27:19.306348-07:00 | ||
custom: | ||
Author: colin-rogers-dbt | ||
Issue: "1318" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Isolating distribution testing | ||
time: 2024-09-10T21:20:52.574204-04:00 | ||
custom: | ||
Author: leahwicz | ||
Issue: "1290" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Under the Hood | ||
body: Separate credentials functionality into its own module for reuse in retry and | ||
python submissions | ||
time: 2024-11-04T17:38:15.940962-05:00 | ||
custom: | ||
Author: mikealfare | ||
Issue: "1391" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Create a retry factory to simplify retry strategies across dbt-bigquery | ||
time: 2024-11-07T14:38:56.210445-05:00 | ||
custom: | ||
Author: mikealfare osalama | ||
Issue: "1395" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from google.api_core.client_info import ClientInfo | ||
from google.api_core.client_options import ClientOptions | ||
from google.api_core.retry import Retry | ||
from google.auth.exceptions import DefaultCredentialsError | ||
from google.cloud.bigquery import Client as BigQueryClient | ||
from google.cloud.dataproc_v1 import BatchControllerClient, JobControllerClient | ||
from google.cloud.storage import Client as StorageClient | ||
|
||
from dbt.adapters.events.logging import AdapterLogger | ||
|
||
import dbt.adapters.bigquery.__version__ as dbt_version | ||
from dbt.adapters.bigquery.credentials import ( | ||
BigQueryCredentials, | ||
create_google_credentials, | ||
set_default_credentials, | ||
) | ||
|
||
|
||
_logger = AdapterLogger("BigQuery") | ||
|
||
|
||
def create_bigquery_client(credentials: BigQueryCredentials) -> BigQueryClient: | ||
try: | ||
return _create_bigquery_client(credentials) | ||
except DefaultCredentialsError: | ||
_logger.info("Please log into GCP to continue") | ||
set_default_credentials() | ||
return _create_bigquery_client(credentials) | ||
|
||
|
||
@Retry() # google decorator. retries on transient errors with exponential backoff | ||
def create_gcs_client(credentials: BigQueryCredentials) -> StorageClient: | ||
return StorageClient( | ||
project=credentials.execution_project, | ||
credentials=create_google_credentials(credentials), | ||
) | ||
|
||
|
||
@Retry() # google decorator. retries on transient errors with exponential backoff | ||
def create_dataproc_job_controller_client(credentials: BigQueryCredentials) -> JobControllerClient: | ||
return JobControllerClient( | ||
credentials=create_google_credentials(credentials), | ||
client_options=ClientOptions(api_endpoint=_dataproc_endpoint(credentials)), | ||
) | ||
|
||
|
||
@Retry() # google decorator. retries on transient errors with exponential backoff | ||
def create_dataproc_batch_controller_client( | ||
credentials: BigQueryCredentials, | ||
) -> BatchControllerClient: | ||
return BatchControllerClient( | ||
credentials=create_google_credentials(credentials), | ||
client_options=ClientOptions(api_endpoint=_dataproc_endpoint(credentials)), | ||
) | ||
|
||
|
||
@Retry() # google decorator. retries on transient errors with exponential backoff | ||
def _create_bigquery_client(credentials: BigQueryCredentials) -> BigQueryClient: | ||
return BigQueryClient( | ||
credentials.execution_project, | ||
create_google_credentials(credentials), | ||
location=getattr(credentials, "location", None), | ||
client_info=ClientInfo(user_agent=f"dbt-bigquery-{dbt_version.version}"), | ||
client_options=ClientOptions(quota_project_id=credentials.quota_project), | ||
) | ||
|
||
|
||
def _dataproc_endpoint(credentials: BigQueryCredentials) -> str: | ||
return f"{credentials.dataproc_region}-dataproc.googleapis.com:443" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.