Lee-W commented on code in PR #40868:
URL: https://github.com/apache/airflow/pull/40868#discussion_r1688101731
##########
airflow/datasets/__init__.py:
##########
@@ -306,6 +350,9 @@ def __init__(self, name: str) -> None:
self.name = name
self.objects = expand_alias_to_datasets(name)
+ def __repr__(self) -> str:
+ return f"_DatasetAliasCondition({', '.join(map(str, self.objects))})"
Review Comment:
This is actually expected. I'd like to use it to separate `DatasetAny` and
`_DatasetAliasCondition`.
##########
airflow/datasets/__init__.py:
##########
@@ -314,6 +361,38 @@ def as_expression(self) -> Any:
"""
return {"alias": self.name}
+ def iter_dag_dependencies(self, *, source: str = "", target: str = "") ->
Iterator[DagDependency]:
+ """
+ Iterate a dataset alias and its resolved datasets as dag dependency.
+
+ :meta private:
+ """
+ if self.objects:
+ for obj in self.objects:
+ dataset = cast(Dataset, obj)
Review Comment:
No nested condition would happen in `_DatasetAliasCondition` (at least in
the current design) . This condition will only expand a `DatasetAlias` to
`DatasetAny( resolved datasets )`
--
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]