dstandish commented on code in PR #25175:
URL: https://github.com/apache/airflow/pull/25175#discussion_r925768619
##########
airflow/serialization/serialized_objects.py:
##########
@@ -839,7 +882,21 @@ def deserialize_operator(cls, encoded_op: Dict[str, Any])
-> Operator:
@classmethod
def detect_dependencies(cls, op: Operator) -> Optional['DagDependency']:
"""Detects between DAG dependencies for the operator."""
- return cls.dependency_detector.detect_task_dependencies(op)
+ dependency_detector = DependencyDetector()
+ custom_dependency_detector = conf.getimport('scheduler',
'dependency_detector')
+ deps = set()
+ if not (custom_dependency_detector is None or
type(dependency_detector) is DependencyDetector):
+ warnings.warn(
+ "Use of a custom dependency detector is deprecated. "
+ "Support will be removed in a future release.",
+ DeprecationWarning,
+ )
+ dep = custom_dependency_detector.detect_task_dependencies(op)
+ if dep:
+ deps.add(dep)
+ deps.update(dependency_detector.detect_task_dependencies(op))
Review Comment:
right, we're storing the deps in a set in order to dedupe. custom
"detector" can only return a single value, we just add it to what we get from
the current detector.
--
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]