diff --git a/core/dbt/adapters/base/relation.py b/core/dbt/adapters/base/relation.py index d44f7b28cfe..f9626bbb05d 100644 --- a/core/dbt/adapters/base/relation.py +++ b/core/dbt/adapters/base/relation.py @@ -147,14 +147,6 @@ def __eq__(self, other): def get_default_quote_policy(cls: Type[Self]) -> Policy: return cls._get_field_named('quote_policy').default - @classmethod - def get_default_include_policy(cls: Type[Self]) -> Policy: - return cls._get_field_named('include_policy').default - - @classmethod - def get_relation_type_class(cls: Type[Self]) -> Type[RelationType]: - return cls._get_field_named('type') - def get(self, key, default=None): """Override `.get` to return a metadata object so we don't break dbt_utils. diff --git a/core/dbt/adapters/sql/impl.py b/core/dbt/adapters/sql/impl.py index 260b17b49d8..a759eceec5d 100644 --- a/core/dbt/adapters/sql/impl.py +++ b/core/dbt/adapters/sql/impl.py @@ -196,6 +196,10 @@ def list_relations_without_caching(self, information_schema, schema): 'identifier': True } for _database, name, _schema, _type in results: + try: + _type = self.Relation.RelationType(_type) + except ValueError: + _type = self.Relation.RelationType.External relations.append(self.Relation.create( database=_database, schema=_schema, diff --git a/plugins/bigquery/dbt/adapters/bigquery/impl.py b/plugins/bigquery/dbt/adapters/bigquery/impl.py index d25cc984e77..463b8ad2620 100644 --- a/plugins/bigquery/dbt/adapters/bigquery/impl.py +++ b/plugins/bigquery/dbt/adapters/bigquery/impl.py @@ -294,7 +294,10 @@ def _bq_table_to_relation(self, bq_table): 'schema': True, 'identifier': True }, - type=self.RELATION_TYPES.get(bq_table.table_type)) + type=self.RELATION_TYPES.get( + bq_table.table_type, RelationType.External + ), + ) @classmethod def warning_on_hooks(hook_type):