bbovenzi commented on code in PR #47381:
URL: https://github.com/apache/airflow/pull/47381#discussion_r1981517348
##########
task_sdk/src/airflow/sdk/definitions/asset/__init__.py:
##########
@@ -451,11 +451,16 @@ def iter_dag_dependencies(self, *, source: str, target:
str) -> Iterator[DagDepe
:meta private:
"""
+ from airflow.models.asset import retrieve_asset_ids
+ from airflow.utils.session import create_session
+
+ with create_session() as session:
+ asset_id = str(retrieve_asset_ids(assets=[self],
session=session)[0])
yield DagDependency(
source=source or "asset",
target=target or "asset",
dependency_type="asset",
- dependency_id=self.name,
+ dependency_id=asset_id,
Review Comment:
I am looking at how we use this in `api-server`:
https://github.com/apache/airflow/blob/main/airflow/api_fastapi/core_api/routes/ui/dependencies.py#L55
Right now, this would result in the graphj just rendering the id number. I
think we should add a separate `label` as a new field on `DagDependency`. This
would also allow us to use `dag_display_name` which would also be great.
--
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]