Skip to content

LatestOnlyOperator not working with TaskSDK Dag import. #48897

@gopidesupavan

Description

@gopidesupavan

Body

Example dag, use the import from airflow.sdk import DAG.

from __future__ import annotations

import datetime

from airflow.providers.standard.operators.empty import EmptyOperator
from airflow.providers.standard.operators.latest_only import LatestOnlyOperator
from airflow.sdk import DAG

with DAG(
    dag_id="latest_only",
    schedule=datetime.timedelta(hours=4),
    start_date=datetime.datetime(2021, 1, 1),
    catchup=False,
    tags=["example2", "example3"],
) as dag:
    latest_only = LatestOnlyOperator(task_id="latest_only")
    task1 = EmptyOperator(task_id="task1")

    latest_only >> task1
Image

We may likely need to port this to TaskSDK

def next_dagrun_info(

@kaxil Any reason some methods are in modes/dag.py ?

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

Labels

kind:bugThis is a clearly a bugkind:metaHigh-level information important to the community

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions