-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Airflow 2.0.0 support? #14
Comments
As far as I am concerned, the best way to handle this is to just *not use for ... in ...:
yield DagRunOrder(payload={ ... }) just yield the payloads directly: for ... in ...:
yield { ... } This already works (see these lines of code that auto-wrap non-DRO results), but in order for this to work in Airflow 2, the whole notion of the DRO instances could be dropped entirely. |
Hi @mjpieters You can start the server with the next instructions (docker required):
As I see in UI -
|
may be the issue in airflow and it will be fixed with a stable release of 2.0.0 version. |
The |
Thanks for updating! I've since created my own re-implementation as I needed the operator sooner; it is largely the same except I sub-classed E.g. the execute method looks like this: @provide_session
def execute(self, context: Dict, session=None):
context.update(self.op_kwargs)
context["templates_dict"] = self.templates_dict
self.op_kwargs = determine_kwargs(self.python_callable, self.op_args, context)
dag_id = self.trigger_dag_id
dag_model = DagModel.get_current(dag_id, session=session)
if dag_model is None:
raise DagNotFound(f"Dag id {dag_id} not found in DagModel")
dag_bag = DagBag(dag_folder=dag_model.fileloc, read_dags_from_db=True)
dag = dag_bag.get_dag(dag_id, session=session)
dag_hash = dag_bag.dags_hash.get(dag_id)
dag_run_ids = []
for run_conf in self.execute_callable():
now = timezone.utcnow()
dag_run = dag.create_dagrun(
state=State.RUNNING,
execution_date=now,
external_trigger=True,
conf=run_conf,
run_type=DagRunType.MANUAL,
dag_hash=dag_hash,
session=session,
)
dag_run_ids.append(dag_run.id)
self.log.info("Created DagRun %s, %s", dag_run, now)
if dag_run_ids:
context["ti"].xcom_push(TRIGGER_DAGRUN_XCOM_KEY, dag_run_ids)
else:
self.log.info("No DagRuns created") |
Sounds reasonable, I'll apply your way. Thank you! |
Hi, is there any update? |
@honarkhah |
Airflow 2.0.0a1 has been released (see https://lists.apache.org/thread.html/rf34558953ba367561574c194500a34d7f3c21fe2798b173b86fc309c%40%3Cdev.airflow.apache.org%3E).
Airflow 2.0.0 no longer has a
DagRunOrder
:see apache/airflow#6317 and this UPDATING note.
The text was updated successfully, but these errors were encountered: