Skip to content

Commit eef329e

Browse files
committed
fix(bigquery): use correct attribute to check routine type
The BigQuery Python client exposes routine type as `type_` (not `routine_type`), since `type` is a Python builtin. Using `RoutineType.PROCEDURE` from the library's enum avoids hardcoding the string "PROCEDURE".
1 parent 5a5eea2 commit eef329e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • dbt-bigquery/src/dbt/adapters/bigquery

dbt-bigquery/src/dbt/adapters/bigquery/impl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import google.oauth2
2424
import google.cloud.bigquery
2525
from google.cloud.bigquery import AccessEntry, Client, SchemaField, Table as BigQueryTable
26+
from google.cloud.bigquery.routine import RoutineType
2627
import google.cloud.exceptions
2728
import pytz
2829

@@ -589,7 +590,7 @@ def _bq_routine_to_relation(self, bq_routine) -> Union[BigQueryRelation, None]:
589590
if bq_routine is None:
590591
return None
591592

592-
if bq_routine.routine_type == "PROCEDURE":
593+
if bq_routine.type_ == RoutineType.PROCEDURE:
593594
return None
594595

595596
return self.Relation.create(

0 commit comments

Comments
 (0)