Returns a list of function SchemaObjects. :param filter_func is a function that accepts a FunctionMetadata namedtuple and returns a boolean indicating whether that function should be kept or discarded
(self, schema, filter_func)
| 957 | ] |
| 958 | |
| 959 | def populate_functions(self, schema, filter_func): |
| 960 | """Returns a list of function SchemaObjects. |
| 961 | |
| 962 | :param filter_func is a function that accepts a FunctionMetadata |
| 963 | namedtuple and returns a boolean indicating whether that |
| 964 | function should be kept or discarded |
| 965 | |
| 966 | """ |
| 967 | |
| 968 | # Because of multiple dispatch, we can have multiple functions |
| 969 | # with the same name, which is why `for meta in metas` is necessary |
| 970 | # in the comprehensions below |
| 971 | return [ |
| 972 | SchemaObject( |
| 973 | name=func, |
| 974 | schema=(self._maybe_schema(schema=sch, parent=schema)), |
| 975 | meta=meta, |
| 976 | ) |
| 977 | for sch in self._get_schemas("functions", schema) |
| 978 | for (func, metas) in self.dbmetadata["functions"][sch].items() |
| 979 | for meta in metas |
| 980 | if filter_func(meta) |
| 981 | ] |
no test coverage detected