(
        self,
        name: str,
        root_project_name: str,
        filter: Optional[Callable[[MacroCandidate], bool]] = None
    )
return candidates
Find macros by their name.
Find macros by their name.
Find macros by their name .
def _find_macros_by_name(
        self,
        name: str,
        root_project_name: str,
        filter: Optional[Callable[[MacroCandidate], bool]] = None
    ) -> CandidateList:
        """Find macros by their name.
        """
        # avoid an import cycle
        from dbt.adapters.factory import get_adapter_package_names
        candidates: CandidateList = CandidateList()
        packages = set(get_adapter_package_names(self.metadata.adapter_type))
        for unique_id, macro in self.macros.items():
            if macro.name != name:
                continue
            candidate = MacroCandidate(
                locality=_get_locality(macro, root_project_name, packages),
                macro=macro,
            )
            if filter is None or filter(candidate):
                candidates.append(candidate)

        return candidates
def _find_macros_by_name ( self , name : str , root_project_name : str , filter : Optional [ Callable [ [ MacroCandidate ] , bool ] ] = None ) -> CandidateList : # avoid an import cycle from dbt . adapters . factory import get_adapter_package_names candidates : CandidateList = CandidateList ( ) packages = set ( get_adapter_package_names ( self . metadata . adapter_type ) ) for unique_id , macro in self . macros . items ( ) : if macro . name != name : continue candidate = MacroCandidate ( locality = _get_locality ( macro , root_project_name , packages ) , macro = macro , ) if filter is None or filter ( candidate ) : candidates . append ( candidate ) return candidates