uranusjr commented on code in PR #41325:
URL: https://github.com/apache/airflow/pull/41325#discussion_r1823778924
##########
airflow/decorators/assets.py:
##########
@@ -79,8 +78,11 @@ def __attrs_post_init__(self) -> None:
with DAG(dag_id=self.name, schedule=self.schedule, auto_register=True)
as dag:
_AssetMainOperator(
task_id="__main__",
- # TODO: This should use the name argument instead.
- inlets=[Asset(uri=k) for k in parameters if k not in ("self",
"context")],
+ inlets=[
+ Asset(name=inlet_aset_name)
+ for inlet_aset_name in parameters
+ if inlet_aset_name not in ("self", "context")
+ ],
Review Comment:
I don’t think this is good enough since `Asset(name="a")` and
`Asset(name="a", uri="somewhere")` are considered different assets. Here we
only have the name, so maybe one way to do this would be to add a stub
(AssetRef?) here, and do a second pass in the DAG processor to get the actual
assets? Or maybe we should just keep the AssetRef here, and add code to task
execution at runtime to resolve it into an actual asset, similar to how we
handle AssetAlias.
--
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]