def af_entrypoint(gt, ds, **kwargs): logger.info(f"ds={ds}") pprint(kwargs) # build Input DataSet from Xcoms ti = kwargs["ti"] ds = DataSet() for d in gt.dependencies: cn = d.task.__class__.__name__ pull_ds = ti.xcom_pull(task_ids=cn) if pull_ds: logger.info(f"found Xcom from {cn}") ds.merge(pull_ds) # Run & retrun Xcoms return gt.task.main(ds)
def _make_task_inputs(self, graph_task: GraphTask, default_ds: DataSet) -> DataSet: """タスクの入力DataSet作成 Args: graph_task (Task): GraphTask default_ds (DataSet): デフォルトDataSet Returns: DataSet: 入力DataSet """ ds = DataSet() ds.merge(self.catalog_ds) if not graph_task.dependencies: ds.merge(default_ds) else: for d in graph_task.dependencies: ds.merge(d.output_ds) return ds