df_merger.py 文件源码

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

项目:Eskapade 作者: KaveIO 项目源码 文件源码
def initialize(self):
        """ Perform basic checks on provided attributes.
        """

        if isinstance(self.on, str):
            self.on = [self.on]
        elif not isinstance(self.on,list):
            raise Exception('on is not a list of strings. Exit.')

        assert len(self.on) > 0, 'not specified on which keys to merge.'
        assert (self.how == 'inner' or self.how == 'outer' or self.how == 'left' or self.how == 'right'), \
            'how to merge not specified correctly.'
        assert len(self.output_collection), 'output_collection not specified.'

        # add back on to kwargs, so it's picked up by pandas.
        if self.on is not None:
            self.kwargs['on'] = self.on
        if self.how is not None:
            self.kwargs['how'] = self.how

        self.log().info('kwargs passed on to pandas merge function are: %s' % self.kwargs )

        return StatusCode.Success
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号