Skip to content
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

Deprecate DAG.run method #42417

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import sys
import time
import traceback
import warnings
import weakref
from collections import abc, defaultdict, deque
from contextlib import ExitStack
Expand Down Expand Up @@ -88,6 +89,7 @@
DuplicateTaskIdFound,
FailStopDagInvalidTriggerRule,
ParamValidationError,
RemovedInAirflow3Warning,
TaskDeferred,
TaskNotFound,
UnknownExecutorException,
Expand Down Expand Up @@ -2331,6 +2333,13 @@ def run(
:param run_at_least_once: If true, always run the DAG at least once even
if no logical run exists within the time range.
"""
warnings.warn(
"`DAG.run()` is deprecated and will be removed in Airflow 3.0. Consider "
"using `DAG.test()` instead, or trigger your dag via API.",
RemovedInAirflow3Warning,
stacklevel=2,
)

from airflow.executors.executor_loader import ExecutorLoader
from airflow.jobs.backfill_job_runner import BackfillJobRunner

Expand Down
Loading