You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jgoedeke (via GitHub)" <gi...@apache.org> on 2025/11/07 16:42:53 UTC

[I] AssetAliases are not shown in assets tab [airflow]

jgoedeke opened a new issue, #58058:
URL: https://github.com/apache/airflow/issues/58058

   ### Apache Airflow version
   
   3.1.2
   
   ### If "Other Airflow 2/3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When using DAGs that attach AssetAliases to outlets, the concrete asset is created by the producing task. AssetAliases associated to these dynamically created assets do not appear in the Assets tab of the UI, even when assets are attached via Metadata and show correct lineage. The following example code demonstrates the issue:
   
   ```python
   from datetime import UTC, datetime
   from airflow.providers.standard.operators.python import PythonOperator
   from airflow.sdk import Asset, AssetAlias, Metadata, dag, task
   
   first_alias = AssetAlias(name='a.first.data.alias',)
   second_alias = AssetAlias(name='a.second.data.alias',)
   
   @dag(schedule=None,tags=['test'],)
   def test_alias_producer_dag():
       def produce_asset():
           yield Metadata(Asset(name='a.first.data.asset', uri='s3://bucket/mydata.csv', extra={'path': '/some/local/path.txt'},), {'timestamp': datetime.now(tz=UTC).isoformat()}, first_alias,)
       PythonOperator(task_id='produce_asset', python_callable=produce_asset, outlets=[first_alias],)
   
   @dag(schedule=[first_alias],tags=['test'],)
   def test_alias_intermediate_dag():
       @task(inlets=[first_alias], outlets=[second_alias])
       def process_asset(inlet_events: dict[Asset | AssetAlias, list[Metadata]]):
           events: list[Metadata] = inlet_events[first_alias]
           for event in events:
               print(f'Event: {event}')
           yield Metadata(Asset(name='a.second.data.asset', uri='s3://bucket/otherdata.csv', extra={'path': '/some/other/local/path.txt'},), {'timestamp': datetime.now(tz=UTC).isoformat()}, second_alias,)
       process_asset()
   
   @dag(schedule=[second_alias],tags=['test'],)
   def test_alias_consumer_dag():
       @task(inlets=[second_alias])
       def consume_asset(inlet_events: dict[Asset | AssetAlias, list[Metadata]]):
           events: list[Metadata] = inlet_events[second_alias]
           for event in events:
               print(f'Event: {event}')
       consume_asset()
   
   test_alias_producer_dag()
   test_alias_intermediate_dag()
   test_alias_consumer_dag()
   ```
   
   Observed behavior:
   - The dynamically attached Asset (with new URI per run) is correctly produced and its lineage appears in the Event Log.
   - The AssetAlias used as outlet does NOT appear as an asset in the 'Assets' tab at all, so it's impossible to track or filter on alias lineage.
   - This seems to affect all dynamically produced assets that use AssetAlias via Metadata.
   
   ### What you think should happen instead?
   
   Expectation: The AssetAlias should appear in the assets tab, allowing lineage tracking and filtering even when the URIs are not constant across runs.
   
   ### How to reproduce
   
   See example DAG code in previous sections. To reproduce:
   1. Define DAG with dynamic assets and attach AssetAlias via Metadata/outlets as in example above
   2. Run the DAG; ensure that asset events are produced with AssetAlias and dynamically generated Asset
   3. Check the Event Log for produced events—you should see proper lineage
   4. The attached AssetAlias (e.g. 'a.first.data.alias') does NOT appear in the assets tab, making lineage via alias impossible to track.
   
   ### Operating System
   
   docker compose
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AssetAliases are not shown in assets tab [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed issue #58058: AssetAliases are not shown in assets tab
URL: https://github.com/apache/airflow/issues/58058


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AssetAliases are not shown in assets tab [airflow]

Posted by "jacopo-exact (via GitHub)" <gi...@apache.org>.
jacopo-exact commented on issue #58058:
URL: https://github.com/apache/airflow/issues/58058#issuecomment-3763824702

   I'm also affected by this issue, using Airflow 3.1.6. CLI correctly shows AssetAlias but asset tab in web UI remains empty.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org