uranusjr commented on code in PR #51229:
URL: https://github.com/apache/airflow/pull/51229#discussion_r2121283208
##########
task-sdk/src/airflow/sdk/definitions/asset/decorators.py:
##########
@@ -111,7 +112,12 @@ class AssetDefinition(Asset):
def __attrs_post_init__(self) -> None:
with self._source.create_dag(default_dag_id=self.name):
- _AssetMainOperator.from_definition(self)
+ if isinstance(self._function, _TaskDecorator):
+ if "outlets" not in self._function.kwargs:
+ self._function.kwargs["outlets"] = [v for _, v in
self.iter_assets()]
+ self._function()
+ else:
+ _AssetMainOperator.from_definition(self)
Review Comment:
Or maybe we should just ban using `outlets` in this situation. It’d confuse
the heck out of the scheduler.
--
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]