sunank200 commented on code in PR #53393:
URL: https://github.com/apache/airflow/pull/53393#discussion_r2268613999


##########
airflow-core/src/airflow/configuration.py:
##########
@@ -202,6 +203,28 @@ def retrieve_configuration_description(
     return base_configuration_description
 
 
+class WeightRule(str, Enum):
+    """Weight rules."""
+
+    DOWNSTREAM = "downstream"
+    UPSTREAM = "upstream"
+    ABSOLUTE = "absolute"
+
+    @classmethod
+    def is_valid(cls, weight_rule: str) -> bool:
+        """Check if weight rule is valid."""
+        return weight_rule in cls.all_weight_rules()
+
+    @methodtools.lru_cache(maxsize=None)
+    @classmethod
+    def all_weight_rules(cls) -> set[str]:
+        """Return all weight rules."""
+        return set(cls.__members__.values())
+
+    def __str__(self) -> str:
+        return self.value

Review Comment:
   These methods can be removed. But this class is good to  have as we use it 
in task-sdk with execution API schema



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