hugochinchilla commented on code in PR #28333:
URL: https://github.com/apache/airflow/pull/28333#discussion_r1049631868
##########
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:
@uranusjr if this was a subclass of list you would need to use it like this:
```python
any_of([dataset1, dataset2])
# with the actual implementation you do:
any_of(dataset1, dataset2)
```
@bolkedebruin can you suggest a better place for it? I thought it was handy
to import both `Dataset` and `any_of` from the same module as they are closely
related.
--
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]