From 43d25e69dbb532d9c0345d70c7a241519139d127 Mon Sep 17 00:00:00 2001 From: Bruno Souza de Lima Date: Tue, 28 Feb 2023 09:13:28 -0300 Subject: [PATCH 1/2] adding bytes_billed to adapter response --- dbt/adapters/bigquery/connections.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbt/adapters/bigquery/connections.py b/dbt/adapters/bigquery/connections.py index 7bcc63c4b..47b2d84c1 100644 --- a/dbt/adapters/bigquery/connections.py +++ b/dbt/adapters/bigquery/connections.py @@ -86,6 +86,7 @@ class BigQueryConnectionMethod(StrEnum): @dataclass class BigQueryAdapterResponse(AdapterResponse): bytes_processed: Optional[int] = None + bytes_billed: Optional[int] = None location: Optional[str] = None project_id: Optional[str] = None job_id: Optional[str] = None @@ -455,6 +456,7 @@ def execute( code = None num_rows = None bytes_processed = None + bytes_billed = None location = None job_id = None project_id = None @@ -489,6 +491,7 @@ def execute( # set common attributes bytes_processed = query_job.total_bytes_processed + bytes_billed = query_job.total_bytes_billed slot_ms = query_job.slot_millis processed_bytes = self.format_bytes(bytes_processed) location = query_job.location @@ -510,6 +513,7 @@ def execute( rows_affected=num_rows, code=code, bytes_processed=bytes_processed, + bytes_billed=bytes_billed, location=location, project_id=project_id, job_id=job_id, From b6dba73162042bba20d003436affc52e2cdd08a3 Mon Sep 17 00:00:00 2001 From: Bruno Souza de Lima Date: Tue, 28 Feb 2023 09:43:01 -0300 Subject: [PATCH 2/2] adding changie --- .changes/unreleased/Features-20230228-094234.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Features-20230228-094234.yaml diff --git a/.changes/unreleased/Features-20230228-094234.yaml b/.changes/unreleased/Features-20230228-094234.yaml new file mode 100644 index 000000000..4929c0834 --- /dev/null +++ b/.changes/unreleased/Features-20230228-094234.yaml @@ -0,0 +1,6 @@ +kind: Features +body: 'Adding `bytes_billed` to `BigQueryAdapterResponse` ' +time: 2023-02-28T09:42:34.557696-03:00 +custom: + Author: bruno-szdl + Issue: "560"