@@ -191,14 +191,32 @@ def expand_model_selections(
191191 models_by_tags .setdefault (tag , set ())
192192 models_by_tags [tag ].add (model .fqn )
193193
194+ def _normalize_for_match (name : str ) -> str :
195+ """Strip surrounding identifier quotes on each component for glob-style matching."""
196+ parts = name .split ("." )
197+
198+ def _unquote (part : str ) -> str :
199+ if len (part ) >= 2 and part [0 ] == part [- 1 ] and part [0 ] in {"'" , '"' , "`" , "[" }:
200+ # For [] quoting, ensure trailing ]
201+ if part [0 ] == "[" and part [- 1 ] != "]" :
202+ return part
203+ return part [1 :- 1 ]
204+ return part
205+
206+ return "." .join (_unquote (p ) for p in parts )
207+
194208 def evaluate (node : exp .Expression ) -> t .Set [str ]:
195209 if isinstance (node , exp .Var ):
196210 pattern = node .this
197211 if "*" in pattern :
212+ normalized_pattern = _normalize_for_match (pattern )
198213 return {
199214 fqn
200215 for fqn , model in all_models .items ()
201- if fnmatch .fnmatchcase (self ._model_name (model ), node .this )
216+ if fnmatch .fnmatchcase (
217+ _normalize_for_match (self ._model_name (model )),
218+ normalized_pattern ,
219+ )
202220 }
203221 return self ._pattern_to_model_fqns (pattern , all_models )
204222 if isinstance (node , exp .And ):
0 commit comments