Skip to content

Optimize subclasses of DummyOperator be set straight to success instead of being run #11393

@turbaszek

Description

@turbaszek

Apache Airflow version:
v2.0.0

What happened:

Custom operators inheriting from DummyOperator are go in to a scheduled state, where as DummyOperator itself is set straight to success.

What you expected to happen:

All operators should be successfully executed.

How to reproduce it:

from datetime import datetime
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator

class MyJob(DummyOperator):
    template_fields_renderers = {
        "body": "json"
    }
    template_fields = ("body",)

    def __init__(self, body, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.body = body

with DAG(
    dag_id="test",
    schedule_interval=None,
    start_date=datetime(2020, 8, 13),
) as dag:
    MyJob(task_id="aaaa", body={"aaa": "bbb"})

Anything else we need to know:
This is a known problem that we will fix, see: #10956 (comment)

Metadata

Metadata

Assignees

Labels

kind:bugThis is a clearly a bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions