pipeline.py 文件源码

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

项目:ozelot 作者: trycs 项目源码 文件源码
def clear(self):
        """Clear output from one (derived) class loader
        """
        # mark this task as incomplete
        self.mark_incomplete()

        # Delete the indicator metadata, this also deletes values by cascading.
        #
        # NOTE: calling 'delete()' on the query (instead of on the queried object,
        # as done here), would NOT work! For a query, there is no in-Python cascading
        # of delete statements in sqlalchemy, so the associated values would not
        # be deleted e.g. for SQLite databases.
        try:
            indicator = self.session.query(models.EuroStatIndicator) \
                .filter(models.EuroStatIndicator.number == self.number) \
                .one()
            self.session.delete(indicator)
        except NoResultFound:
            # Data didn't exist yet, no problem
            pass

        self.close_session()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号