diff --git a/dbt/adapters/bigquery/impl.py b/dbt/adapters/bigquery/impl.py index bb04c78b8..ff697c9cb 100644 --- a/dbt/adapters/bigquery/impl.py +++ b/dbt/adapters/bigquery/impl.py @@ -217,6 +217,10 @@ class BigQueryAdapter(BaseAdapter): ConstraintType.foreign_key: ConstraintSupport.ENFORCED, } + def __init__(self, config) -> None: + super().__init__(config) + self.connections: BigQueryConnectionManager = self.connections + ### # Implementations of abstract methods ### @@ -481,40 +485,6 @@ def _agate_to_schema( bq_schema.append(SchemaField(col_name, type_)) # type: ignore[arg-type] return bq_schema - def _materialize_as_view(self, model: Dict[str, Any]) -> str: - model_database = model.get("database") - model_schema = model.get("schema") - model_alias = model.get("alias") - model_code = model.get("compiled_code") - - logger.debug("Model SQL ({}):\n{}".format(model_alias, model_code)) - self.connections.create_view( - database=model_database, schema=model_schema, table_name=model_alias, sql=model_code - ) - return "CREATE VIEW" - - def _materialize_as_table( - self, - model: Dict[str, Any], - model_sql: str, - decorator: Optional[str] = None, - ) -> str: - model_database = model.get("database") - model_schema = model.get("schema") - model_alias = model.get("alias") - - if decorator is None: - table_name = model_alias - else: - table_name = "{}${}".format(model_alias, decorator) - - logger.debug("Model SQL ({}):\n{}".format(table_name, model_sql)) - self.connections.create_table( - database=model_database, schema=model_schema, table_name=table_name, sql=model_sql - ) - - return "CREATE TABLE" - @available.parse(lambda *a, **k: "") def copy_table(self, source, destination, materialization): if materialization == "incremental":