diff --git a/core/dbt/context/providers.py b/core/dbt/context/providers.py index 604d81c66f3..eb5e76292e7 100644 --- a/core/dbt/context/providers.py +++ b/core/dbt/context/providers.py @@ -688,8 +688,15 @@ def resolve(self, source_name: str, table_name: str): class SourceQuotingConfig: quoting: Dict[str, Any] = {"database": False, "schema": False, "identifier": False} + # Preserve legacy behaviour where sources do not consider quoting configuration from dbt_project.yml + base_quoting_config = ( + self.config + if self.config.args.source_quoting_respects_project_config + else SourceQuotingConfig() + ) + relation = self.Relation.create_from( - SourceQuotingConfig(), + base_quoting_config, target_source, limit=self.resolve_limit, event_time_filter=self.resolve_event_time_filter(target_source), diff --git a/core/dbt/contracts/project.py b/core/dbt/contracts/project.py index f5a4ec605ec..6a5220167fd 100644 --- a/core/dbt/contracts/project.py +++ b/core/dbt/contracts/project.py @@ -341,6 +341,7 @@ class ProjectFlags(ExtensibleDbtClassMixin): require_explicit_package_overrides_for_builtin_materializations: bool = True require_resource_names_without_spaces: bool = False source_freshness_run_project_hooks: bool = False + source_quoting_respects_project_config: bool = False skip_nodes_if_on_run_start_fails: bool = False state_modified_compare_more_unrendered_values: bool = False state_modified_compare_vars: bool = False @@ -351,6 +352,7 @@ def project_only_flags(self) -> Dict[str, Any]: "require_explicit_package_overrides_for_builtin_materializations": self.require_explicit_package_overrides_for_builtin_materializations, "require_resource_names_without_spaces": self.require_resource_names_without_spaces, "source_freshness_run_project_hooks": self.source_freshness_run_project_hooks, + "source_quoting_respects_project_config": self.source_quoting_respects_project_config, "skip_nodes_if_on_run_start_fails": self.skip_nodes_if_on_run_start_fails, "state_modified_compare_more_unrendered_values": self.state_modified_compare_more_unrendered_values, "state_modified_compare_vars": self.state_modified_compare_vars,