File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ def _macro_references(
661661 return result
662662
663663 for macro_node_id in node .depends_on .macros :
664- if not macro_node_id :
664+ if not macro_node_id or macro_node_id == "None" :
665665 continue
666666
667667 macro_node = manifest .macros [macro_node_id ]
Original file line number Diff line number Diff line change @@ -304,3 +304,23 @@ def test_convert_jinja_test_to_macro():
304304{%- endmacro -%}"""
305305
306306 assert _convert_jinja_test_to_macro (macro_input ) == macro_input
307+
308+
309+ @pytest .mark .xdist_group ("dbt_manifest" )
310+ def test_macro_depenency_none_str ():
311+ project_path = Path ("tests/fixtures/dbt/sushi_test" )
312+ profile = Profile .load (DbtContext (project_path ))
313+ helper = ManifestHelper (
314+ project_path ,
315+ project_path ,
316+ "sushi" ,
317+ profile .target ,
318+ model_defaults = ModelDefaultsConfig (start = "2020-01-01" ),
319+ )
320+ node = helper ._manifest .nodes ["model.customers.customer_revenue_by_day" ]
321+ node .depends_on .macros .append ("None" )
322+
323+ from sqlmesh .dbt .manifest import _macro_references
324+
325+ # "None" macro shouldn't raise a KeyError
326+ _macro_references (helper ._manifest , node )
You can’t perform that action at this time.
0 commit comments