This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 751fba29f2 Removed unused and deprecated custom dag dependancy 
detector from serialization (#42640)
751fba29f2 is described below

commit 751fba29f2d5242844a47336c5bbe46af8ccf4c0
Author: Gopal Dirisala <[email protected]>
AuthorDate: Fri Oct 4 12:59:29 2024 +0530

    Removed unused and deprecated custom dag dependancy detector from 
serialization (#42640)
    
    * Removed unused and deprecated custom dag dependancy detector from 
serilization tests
    
    * Added news fragment
---
 newsfragments/42640.significant.rst           |  1 +
 tests/serialization/test_dag_serialization.py | 33 ---------------------------
 2 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/newsfragments/42640.significant.rst 
b/newsfragments/42640.significant.rst
new file mode 100644
index 0000000000..a6f09eba8b
--- /dev/null
+++ b/newsfragments/42640.significant.rst
@@ -0,0 +1 @@
+Removed deprecated custom dag dependency detector.
diff --git a/tests/serialization/test_dag_serialization.py 
b/tests/serialization/test_dag_serialization.py
index 6910514776..d063b3e780 100644
--- a/tests/serialization/test_dag_serialization.py
+++ b/tests/serialization/test_dag_serialization.py
@@ -65,12 +65,10 @@ from airflow.operators.empty import EmptyOperator
 from airflow.providers.cncf.kubernetes.pod_generator import PodGenerator
 from airflow.security import permissions
 from airflow.sensors.bash import BashSensor
-from airflow.serialization.dag_dependency import DagDependency
 from airflow.serialization.enums import Encoding
 from airflow.serialization.json_schema import load_dag_schema_dict
 from airflow.serialization.serialized_objects import (
     BaseSerialization,
-    DependencyDetector,
     SerializedBaseOperator,
     SerializedDAG,
 )
@@ -87,42 +85,11 @@ from tests.test_utils.mock_operators import AirflowLink2, 
CustomOperator, Google
 from tests.test_utils.timetables import CustomSerializationTimetable, 
cron_timetable, delta_timetable
 
 if TYPE_CHECKING:
-    from airflow.models.operator import Operator
     from airflow.utils.context import Context
 
 repo_root = Path(airflow.__file__).parent.parent
 
 
-class CustomDepOperator(BashOperator):
-    """
-    Used for testing custom dependency detector.
-
-    TODO: remove in Airflow 3.0
-    """
-
-
-class CustomDependencyDetector(DependencyDetector):
-    """
-    Prior to deprecation of custom dependency detector, the return type as 
DagDependency | None.
-    This class verifies that custom dependency detector classes which assume 
that return type will still
-    work until support for them is removed in 3.0.
-
-    TODO: remove in Airflow 3.0
-    """
-
-    @staticmethod
-    def detect_task_dependencies(task: Operator) -> DagDependency | None:  # 
type: ignore
-        if isinstance(task, CustomDepOperator):
-            return DagDependency(
-                source=task.dag_id,
-                target="nothing",
-                dependency_type="abc",
-                dependency_id=task.task_id,
-            )
-        else:
-            return DependencyDetector().detect_task_dependencies(task)  # 
type: ignore
-
-
 executor_config_pod = k8s.V1Pod(
     metadata=k8s.V1ObjectMeta(name="my-name"),
     spec=k8s.V1PodSpec(

Reply via email to