gopidesupavan opened a new issue, #48897:
URL: https://github.com/apache/airflow/issues/48897
### 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
```
<img width="1629" alt="Image"
src="https://github.com/user-attachments/assets/62987f13-f3ec-4cb4-b5dc-237492199a8f"
/>
We may likely need to port this to TaskSDK
https://github.com/apache/airflow/blob/7bd1aa6bc0f0f4d6703d21e3accb87a8ed9e614c/airflow-core/src/airflow/models/dag.py#L571
@kaxil Any reason some methods are in modes/dag.py ?
### Committer
- [x] I acknowledge that I am a maintainer/committer of the Apache Airflow
project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]