pipelines.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:datapipelines-python 作者: meraki-analytics 项目源码 文件源码
def _create_source_handlers(self, type: Type[T]) -> List[_SourceHandler]:
        source_handlers = []
        for source, targets in self._sources:
            if TYPE_WILDCARD in source.provides or type in source.provides:
                sink_handlers = self._create_sink_handlers(type, targets)
                source_handlers.append(_SourceHandler(source, type, _identity, {sink_handler: False for sink_handler in sink_handlers}))
            else:
                try:
                    transform, source_type, cost = self._best_transform_to(type, source.provides)
                    # If we got past the above function call, then there is a transformer from `source_type` to `type`
                    pre_handlers, post_handlers = self._create_sink_handlers_simultaneously(source_type, transform, type, targets)
                    sink_handlers = {sink_handler: False for sink_handler in pre_handlers}
                    sink_handlers.update({sink_handler: True for sink_handler in post_handlers})
                    source_handlers.append(_SourceHandler(source, source_type, transform, sink_handlers))
                except NoConversionError:
                    pass

        return source_handlers
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号