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" diff --git a/dbt/adapters/bigquery/connections.py b/dbt/adapters/bigquery/connections.py index 470475d7a..a561eb5b9 100644 --- a/dbt/adapters/bigquery/connections.py +++ b/dbt/adapters/bigquery/connections.py @@ -89,6 +89,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 @@ -471,6 +472,7 @@ def execute( code = None num_rows = None bytes_processed = None + bytes_billed = None location = None job_id = None project_id = None @@ -505,6 +507,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 @@ -526,6 +529,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,