Repository: dbt-labs/dbt-core

Issue:
Enable deprecation: column-quoting-unset
Introduced in: v0.15
In the last week, raised by: 619 projects (~9%)

We should do as the [deprecation warning](https://github.com/dbt-labs/dbt/blob/95cca277c90fb1c3139e1ae4990a29d8038afcd0/core/dbt/deprecations.py#L89-L90) says, and switch the default from `False` to `True`. That's it in a nutshell.

I think we'll want to override/reimplement the `quote_seed_column` method on the `dbt-snowflake` adapter only, and set the default there to `False` in `dbt-snowflake`, since quoting is such a pain on Snowflake. There's precedent for doing that elsewhere: see [quote policy for relations](https://github.com/dbt-labs/dbt/blob/95cca277c90fb1c3139e1ae4990a29d8038afcd0/plugins/snowflake/dbt/adapters/snowflake/relation.py#L5-L9), and [docs on project-level quoting config](https://docs.getdbt.com/reference/project-configs/quoting).

https://github.com/dbt-labs/dbt/blob/95cca277c90fb1c3139e1ae4990a29d8038afcd0/core/dbt/adapters/base/impl.py#L810-L815


_Originally posted by @jtcohen6 in https://github.com/dbt-labs/dbt/issues/2798#issuecomment-919998174_


Discussion:

Resolving patch:
diff --git a/core/dbt/adapters/base/impl.py b/core/dbt/adapters/base/impl.py
--- a/core/dbt/adapters/base/impl.py
+++ b/core/dbt/adapters/base/impl.py
@@ -797,12 +797,11 @@ def quote_as_configured(self, identifier: str, quote_key: str) -> str:
     def quote_seed_column(
         self, column: str, quote_config: Optional[bool]
     ) -> str:
-        # this is the default for now
-        quote_columns: bool = False
+        quote_columns: bool = True
         if isinstance(quote_config, bool):
             quote_columns = quote_config
         elif quote_config is None:
-            deprecations.warn('column-quoting-unset')
+            pass
         else:
             raise_compiler_error(
                 f'The seed configuration value of "quote_columns" has an '
diff --git a/core/dbt/deprecations.py b/core/dbt/deprecations.py
--- a/core/dbt/deprecations.py
+++ b/core/dbt/deprecations.py
@@ -66,21 +66,6 @@ class NotADictionaryDeprecation(DBTDeprecation):
     '''
 
 
-class ColumnQuotingDeprecation(DBTDeprecation):
-    _name = 'column-quoting-unset'
-
-    _description = '''\
-    The quote_columns parameter was not set for seeds, so the default value of
-    False was chosen. The default will change to True in a future release.
-
-
-
-    For more information, see:
-
-    https://docs.getdbt.com/v0.15/docs/seeds#section-specify-column-quoting
-    '''
-
-
 class ModelsKeyNonModelDeprecation(DBTDeprecation):
     _name = 'models-key-mismatch'
 
@@ -163,7 +148,6 @@ def warn(name, *args, **kwargs):
 deprecations_list: List[DBTDeprecation] = [
     DispatchPackagesDeprecation(),
     NotADictionaryDeprecation(),
-    ColumnQuotingDeprecation(),
     ModelsKeyNonModelDeprecation(),
     ExecuteMacrosReleaseDeprecation(),
     AdapterMacroDeprecation(),
diff --git a/plugins/snowflake/dbt/adapters/snowflake/impl.py b/plugins/snowflake/dbt/adapters/snowflake/impl.py
--- a/plugins/snowflake/dbt/adapters/snowflake/impl.py
+++ b/plugins/snowflake/dbt/adapters/snowflake/impl.py
@@ -13,7 +13,9 @@
 from dbt.adapters.snowflake import SnowflakeRelation
 from dbt.adapters.snowflake import SnowflakeColumn
 from dbt.contracts.graph.manifest import Manifest
-from dbt.exceptions import RuntimeException, DatabaseException
+from dbt.exceptions import (
+    raise_compiler_error, RuntimeException, DatabaseException
+)
 from dbt.utils import filter_null_values
 
 
@@ -163,6 +165,25 @@ def list_relations_without_caching(
 
         return relations
 
+    def quote_seed_column(
+        self, column: str, quote_config: Optional[bool]
+    ) -> str:
+        quote_columns: bool = False
+        if isinstance(quote_config, bool):
+            quote_columns = quote_config
+        elif quote_config is None:
+            pass
+        else:
+            raise_compiler_error(
+                f'The seed configuration value of "quote_columns" has an '
+                f'invalid type {type(quote_config)}'
+            )
+
+        if quote_columns:
+            return self.quote(column)
+        else:
+            return column
+
     def timestamp_add_sql(
         self, add_to: str, number: int = 1, interval: str = 'hour'
     ) -> str:


Test patch:
diff --git a/test/integration/013_context_var_tests/first_dependency/dbt_project.yml b/test/integration/013_context_var_tests/first_dependency/dbt_project.yml
--- a/test/integration/013_context_var_tests/first_dependency/dbt_project.yml
+++ b/test/integration/013_context_var_tests/first_dependency/dbt_project.yml
@@ -24,4 +24,4 @@ vars:
 
 
 seeds:
-  quote_columns: False
+  quote_columns: True
diff --git a/test/integration/052_column_quoting/test_column_quotes.py b/test/integration/052_column_quoting/test_column_quotes.py
--- a/test/integration/052_column_quoting/test_column_quotes.py
+++ b/test/integration/052_column_quoting/test_column_quotes.py
@@ -30,7 +30,7 @@ def project_config(self):
 
     @property
     def models(self):
-        return self.dir('models-unquoted')
+        return self.dir('models')
 
     def run_dbt(self, *args, **kwargs):
         return super().run_dbt(*args, **kwargs)
@@ -43,15 +43,30 @@ def test_postgres_column_quotes(self):
     def test_redshift_column_quotes(self):
         self._run_columnn_quotes()
 
-    @use_profile('snowflake')
-    def test_snowflake_column_quotes(self):
-        self._run_columnn_quotes()
-
     @use_profile('bigquery')
     def test_bigquery_column_quotes(self):
         self._run_columnn_quotes(strategy='merge')
 
 
+class TestColumnQuotingSnowflakeDefault(BaseColumnQuotingTest):
+    @property
+    def project_config(self):
+        return {
+            'config-version': 2
+        }
+
+    @property
+    def models(self):
+        return self.dir('models-unquoted')
+
+    def run_dbt(self, *args, **kwargs):
+        return super().run_dbt(*args, **kwargs)
+
+    @use_profile('snowflake')
+    def test_snowflake_column_quotes(self):
+        self._run_columnn_quotes()
+
+
 class TestColumnQuotingDisabled(BaseColumnQuotingTest):
     @property
     def models(self):