@@ -324,3 +324,79 @@ 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+ # Create dbt_project.yml with quoting config
332+ (tmp_path / "dbt_project.yml" ).write_text ("""
333+ name: 'test_project'
334+ version: '1.0.0'
335+ config-version: 2
336+ profile: 'test_project'
337+
338+ model-paths: ["models"]
339+
340+ models:
341+ test_project:
342+ +materialized: table
343+
344+ quoting:
345+ database: true
346+ schema: true
347+ identifier: false
348+ """ )
349+
350+ # Create profiles.yml
351+ (tmp_path / "profiles.yml" ).write_text ("""
352+ test_project:
353+ target: dev
354+ outputs:
355+ dev:
356+ type: duckdb
357+ path: ':memory:'
358+ """ )
359+
360+ # Create a simple model without quoting override
361+ models_dir = tmp_path / "models"
362+ models_dir .mkdir ()
363+ (models_dir / "test_model.sql" ).write_text ("SELECT 1 as id" )
364+
365+ # Create a model with inline quoting override
366+ (models_dir / "test_model_with_override.sql" ).write_text ("""
367+ {{
368+ config(
369+ quoting={
370+ "database": false,
371+ "schema": false,
372+ "identifier": true
373+ }
374+ )
375+ }}
376+ SELECT 2 as id
377+ """ )
378+
379+ profile = Profile .load (DbtContext (tmp_path ))
380+ helper = ManifestHelper (
381+ tmp_path ,
382+ tmp_path ,
383+ "test_project" ,
384+ profile .target ,
385+ model_defaults = ModelDefaultsConfig (start = "2020-01-01" ),
386+ )
387+
388+ models = helper .models ()
389+ test_model = models ["test_model" ]
390+
391+ # Model should inherit quoting from dbt_project.yml
392+ assert test_model .quoting is not None
393+ assert test_model .quoting ["database" ] is True
394+ assert test_model .quoting ["schema" ] is True
395+ assert test_model .quoting ["identifier" ] is False
396+
397+ # Model with inline override should use its own quoting settings
398+ test_model_override = models ["test_model_with_override" ]
399+ assert test_model_override .quoting is not None
400+ assert test_model_override .quoting ["database" ] is False
401+ assert test_model_override .quoting ["schema" ] is False
402+ assert test_model_override .quoting ["identifier" ] is True
0 commit comments