@@ -324,3 +324,84 @@ def test_macro_depenency_none_str():
324324
325325 # "None" macro shouldn't raise a KeyError
326326 _macro_references (helper ._manifest , node )
327+
328+
329+ @pytest .mark .xdist_group ("dbt_manifest" )
330+ def test_quoting_config (tmp_path : Path ):
331+ if DBT_VERSION < (1 , 10 , 0 ):
332+ pytest .skip (
333+ "The 'quoting' setting in dbt_projects.yml is not respected for dbt-core < v1.10"
334+ )
335+
336+ # Create dbt_project.yml with quoting config
337+ (tmp_path / "dbt_project.yml" ).write_text ("""
338+ name: 'test_project'
339+ version: '1.0.0'
340+ config-version: 2
341+ profile: 'test_project'
342+
343+ model-paths: ["models"]
344+
345+ models:
346+ test_project:
347+ +materialized: table
348+
349+ quoting:
350+ database: true
351+ schema: true
352+ identifier: false
353+ """ )
354+
355+ # Create profiles.yml
356+ (tmp_path / "profiles.yml" ).write_text ("""
357+ test_project:
358+ target: dev
359+ outputs:
360+ dev:
361+ type: duckdb
362+ path: ':memory:'
363+ """ )
364+
365+ # Create a simple model without quoting override
366+ models_dir = tmp_path / "models"
367+ models_dir .mkdir ()
368+ (models_dir / "test_model.sql" ).write_text ("SELECT 1 as id" )
369+
370+ # Create a model with inline quoting override
371+ (models_dir / "test_model_with_override.sql" ).write_text ("""
372+ {{
373+ config(
374+ quoting={
375+ "database": false,
376+ "schema": false,
377+ "identifier": true
378+ }
379+ )
380+ }}
381+ SELECT 2 as id
382+ """ )
383+
384+ profile = Profile .load (DbtContext (tmp_path ))
385+ helper = ManifestHelper (
386+ tmp_path ,
387+ tmp_path ,
388+ "test_project" ,
389+ profile .target ,
390+ model_defaults = ModelDefaultsConfig (start = "2020-01-01" ),
391+ )
392+
393+ models = helper .models ()
394+ test_model = models ["test_model" ]
395+
396+ # Model should inherit quoting from dbt_project.yml
397+ assert test_model .quoting is not None
398+ assert test_model .quoting ["database" ] is True
399+ assert test_model .quoting ["schema" ] is True
400+ assert test_model .quoting ["identifier" ] is False
401+
402+ # Model with inline override should use its own quoting settings
403+ test_model_override = models ["test_model_with_override" ]
404+ assert test_model_override .quoting is not None
405+ assert test_model_override .quoting ["database" ] is False
406+ assert test_model_override .quoting ["schema" ] is False
407+ assert test_model_override .quoting ["identifier" ] is True
0 commit comments