models.py 文件源码

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

项目:airflow 作者: apache-airflow 项目源码 文件源码
def __init__(self, event, task_instance, owner=None, extra=None, **kwargs):
        self.dttm = datetime.now()
        self.event = event
        self.extra = extra

        task_owner = None

        if task_instance:
            self.dag_id = task_instance.dag_id
            self.task_id = task_instance.task_id
            self.execution_date = task_instance.execution_date
            task_owner = task_instance.task.owner

        if 'task_id' in kwargs:
            self.task_id = kwargs['task_id']
        if 'dag_id' in kwargs:
            self.dag_id = kwargs['dag_id']
        if 'execution_date' in kwargs:
            if kwargs['execution_date']:
                self.execution_date = kwargs['execution_date']

        self.owner = owner or task_owner
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号