OscarLigthart commented on code in PR #59764:
URL: https://github.com/apache/airflow/pull/59764#discussion_r2824115559
##########
airflow-core/src/airflow/serialization/definitions/dag.py:
##########
@@ -1008,7 +1012,42 @@ def clear(
tuples that should not be cleared
:param exclude_run_ids: A set of ``run_id`` or (``run_id``)
"""
- from airflow.models.taskinstance import clear_task_instances
+ from airflow.models.taskinstance import (
+ _get_new_task_ids,
+ _update_dagrun_to_latest_version,
+ clear_task_instances,
+ )
+
+ if only_new:
+ if not run_id:
+ raise ValueError("only_new requires run_id to be specified")
+ task_ids = _get_new_task_ids(self.dag_id, run_id, session)
+
+ if dry_run:
Review Comment:
@jedcunningham I'm not sure if we want all the logic below this in the
serialization. I can move it into `_get_new_task_ids` to retrieve a list of ids
and a list of TIs.
Let me know what you prefer.
--
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]