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