jennifer390 commented on code in PR #66884:
URL: https://github.com/apache/airflow/pull/66884#discussion_r3244199172


##########
airflow-core/tests/unit/cli/commands/test_task_command.py:
##########
@@ -541,6 +541,48 @@ def test_task_render_for_multi_line_properties(self, 
dag_maker):
         # no indentation before property name
         assert "# property: bash_command" in output.split("\n")
 
+    def test_task_clear_with_dag_regex_returns_serialized_dags(self):
+        """
+        ``tasks clear --dag-regex`` should resolve matching Dags via the 
serialized Dag
+        table so that ``SerializedDAG.clear_dags`` can call ``.clear()`` on 
them.
+
+        Regression test for the regex branch of ``get_dags(from_db=True)``: 
previously
+        it ignored ``from_db`` and parsed bundles off disk, returning SDK 
``DAG``
+        objects (no ``.clear`` method) and causing ``AttributeError`` 
downstream.
+
+        Note: despite the ``--dag-regex`` name, the implementation calls
+        ``re.search(pattern, dag_id)`` — unanchored, so a plain string like
+        ``"example_python"`` matches any dag_id containing that substring.
+        """

Review Comment:
   attacked the verbosity on all the comments, I blame myself for stopping 
Claude repeatedly during this bug fix process to tell it it was wrong and why 
in detail, I had the poor thing a bit defensive at the end 😆 



-- 
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]

Reply via email to