Skip to content

Commit

Permalink
Fix dag.clear usages after change from apache#9824 (apache#9909)
Browse files Browse the repository at this point in the history
apache#9824 introduced changes in the signature of dag.clear(...) 
but not all occurrences of invocation were adjusted.
  • Loading branch information
turbaszek authored Jul 21, 2020
1 parent 7dd5c11 commit 95632ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion TESTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,8 @@ It will run a backfill job:
.. code-block:: python
if __name__ == '__main__':
dag.clear(reset_dag_runs=True)
from airflow.utils.state import State
dag.clear(dag_run_state=State.NONE)
dag.run()
Expand Down
3 changes: 2 additions & 1 deletion docs/executor/debug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ It will run a backfill job:
.. code-block:: python
if __name__ == '__main__':
dag.clear(reset_dag_runs=True)
from airflow.utils.state import State
dag.clear(dag_run_state=State.NONE)
dag.run()
Expand Down
3 changes: 2 additions & 1 deletion tests/test_utils/system_tests_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from airflow.models.dagbag import DagBag
from airflow.utils.file import mkdirs
from airflow.utils.log.logging_mixin import LoggingMixin
from airflow.utils.state import State
from tests.test_utils import AIRFLOW_MAIN_FOLDER
from tests.utils.logging_command_executor import get_executor

Expand Down Expand Up @@ -149,7 +150,7 @@ def run_dag(self, dag_id: str, dag_folder: str = DEFAULT_DAG_FOLDER) -> None:
)

self.log.info("Attempting to run DAG: %s", dag_id)
dag.clear(reset_dag_runs=True)
dag.clear(dag_run_state=State.NONE)
try:
dag.run(ignore_first_depends_on_past=True, verbose=True)
except Exception:
Expand Down

0 comments on commit 95632ce

Please sign in to comment.