You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/15 12:34:07 UTC

[GitHub] [airflow] bolkedebruin commented on a diff in pull request #28333: Allow a DAG to be scheduled when any related DataSet is updated

bolkedebruin commented on code in PR #28333:
URL: https://github.com/apache/airflow/pull/28333#discussion_r1049586025


##########
airflow/datasets/__init__.py:
##########
@@ -42,3 +43,13 @@ def _check_uri(self, attr, uri: str):
         parsed = urlsplit(uri)
         if parsed.scheme and parsed.scheme.lower() == "airflow":
             raise ValueError(f"{attr.name!r} scheme `airflow` is reserved")
+
+
+class any_of(UserList):
+    """
+    Custom collection to represent a list of Datasets that will trigger a
+    DAG run when any of them is updated.
+    """
+
+    def __init__(self, *datasets: Dataset):
+        super().__init__([*datasets])

Review Comment:
   Looking at it firther I don't think implementing this as a class makes sense. It isn't equivalent to a Dataset. We are coercing the rule now into Dataset-like thing which isnt sound imho.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org