[AIRFLOW-6860] Default ignore_first_depends_on_past to True (#7490)
This commit is contained in:
Родитель
dc78387815
Коммит
2ea9278f76
|
@ -61,6 +61,11 @@ https://developers.google.com/style/inclusive-documentation
|
|||
|
||||
-->
|
||||
|
||||
### Deprecating ignore_first_depends_on_past on backfill command and default it to True
|
||||
|
||||
When doing backfill with `depends_on_past` dags, users will need to pass `ignore_first_depends_on_past`.
|
||||
We should default it as `true` to avoid confusion
|
||||
|
||||
### Custom executors is loaded using full import path
|
||||
|
||||
In previous versions of Airflow it was possible to use plugins to load custom executors. It is still
|
||||
|
|
|
@ -67,6 +67,13 @@ def dag_backfill(args, dag=None):
|
|||
|
||||
signal.signal(signal.SIGTERM, sigint_handler)
|
||||
|
||||
import warnings
|
||||
warnings.warn('--ignore_first_depends_on_past is deprecated as the value is always set to True',
|
||||
category=PendingDeprecationWarning)
|
||||
|
||||
if args.ignore_first_depends_on_past is False:
|
||||
args.ignore_first_depends_on_past = True
|
||||
|
||||
dag = dag or get_dag(args.subdir, args.dag_id)
|
||||
|
||||
if not args.start_date and not args.end_date:
|
||||
|
|
|
@ -1010,7 +1010,7 @@ class BaseOperator(Operator, LoggingMixin):
|
|||
self,
|
||||
start_date: Optional[datetime] = None,
|
||||
end_date: Optional[datetime] = None,
|
||||
ignore_first_depends_on_past: bool = False,
|
||||
ignore_first_depends_on_past: bool = True,
|
||||
ignore_ti_state: bool = False,
|
||||
mark_success: bool = False) -> None:
|
||||
"""
|
||||
|
|
|
@ -1331,7 +1331,7 @@ class DAG(BaseDag, LoggingMixin):
|
|||
executor=None,
|
||||
donot_pickle=conf.getboolean('core', 'donot_pickle'),
|
||||
ignore_task_deps=False,
|
||||
ignore_first_depends_on_past=False,
|
||||
ignore_first_depends_on_past=True,
|
||||
pool=None,
|
||||
delay_on_limit_secs=1.0,
|
||||
verbose=False,
|
||||
|
|
|
@ -72,7 +72,7 @@ class TestCliDags(unittest.TestCase):
|
|||
conf=None,
|
||||
delay_on_limit_secs=1.0,
|
||||
donot_pickle=False,
|
||||
ignore_first_depends_on_past=False,
|
||||
ignore_first_depends_on_past=True,
|
||||
ignore_task_deps=False,
|
||||
local=False,
|
||||
mark_success=False,
|
||||
|
@ -111,7 +111,7 @@ class TestCliDags(unittest.TestCase):
|
|||
conf=None,
|
||||
delay_on_limit_secs=1.0,
|
||||
donot_pickle=False,
|
||||
ignore_first_depends_on_past=False,
|
||||
ignore_first_depends_on_past=True,
|
||||
ignore_task_deps=False,
|
||||
local=True,
|
||||
mark_success=False,
|
||||
|
|
|
@ -785,7 +785,7 @@ class TestTaskInstance(unittest.TestCase):
|
|||
ti = TI(task, run_date)
|
||||
|
||||
# depends_on_past prevents the run
|
||||
task.run(start_date=run_date, end_date=run_date)
|
||||
task.run(start_date=run_date, end_date=run_date, ignore_first_depends_on_past=False)
|
||||
ti.refresh_from_db()
|
||||
self.assertIs(ti.state, None)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче