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

[I] Assets belonging to AssetAlias do not show up on Airflow UI [airflow]

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

   ### Apache Airflow version
   
   3.0.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I ran the following code in airflow 3.0.2. I was hoping to see an asset in the airflow ui, none was shown
   
   `# Licensed to the Apache Software Foundation (ASF) under one
   # or more contributor license agreements.  See the NOTICE file
   # distributed with this work for additional information
   # regarding copyright ownership.  The ASF licenses this file
   # to you under the Apache License, Version 2.0 (the
   # "License"); you may not use this file except in compliance
   # with the License.  You may obtain a copy of the License at
   #
   #   http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing,
   # software distributed under the License is distributed on an
   # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   # KIND, either express or implied.  See the License for the
   # specific language governing permissions and limitations
   # under the License.
   """
   Example DAG for demonstrating the behavior of the AssetAlias feature in Airflow, including conditional and
   asset expression-based scheduling.
   
   Notes on usage:
   
   Turn on all the DAGs.
   
   Once the "asset_s3_bucket_producer" DAG is triggered, the "asset_s3_bucket_consumer" DAG should be triggered upon completion.
   This is because the asset alias "example-alias" is used to add an asset event to the asset "s3://bucket/my-task"
   during the "produce_asset_events_through_asset_alias" task.
   As the DAG "asset-alias-consumer" relies on asset alias "example-alias" which was previously unresolved,
   the DAG "asset-alias-consumer" (along with all the DAGs in the same file) will be re-parsed and
   thus update its schedule to the asset "s3://bucket/my-task" and will also be triggered.
   """
   
   from __future__ import annotations
   
   import pendulum
   
   from airflow.sdk import DAG, Asset, AssetAlias, task
   
   
   with DAG(
       dag_id="asset_alias_example_alias_producer",
       start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
       schedule=None,
       catchup=False,
       tags=["producer", "asset-alias"],
   ):
   
       @task(outlets=[AssetAlias("example-alias")])
       def produce_asset_events_through_asset_alias(*, outlet_events=None):
           bucket_name = "bucket-99"
           object_path = "my-task"
           outlet_events[AssetAlias("example-alias")].add(Asset(f"s3://{bucket_name}/{object_path}"))
   
   
       produce_asset_events_through_asset_alias()
   
   
   with DAG(
       dag_id="asset_alias_example_alias_consumer",
       start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
       schedule=[AssetAlias("example-alias")],
       catchup=False,
       tags=["consumer", "asset-alias"],
   ):
   
       @task(inlets=[AssetAlias("example-alias")])
   
   
       def consume_asset_event_from_asset_alias(*, inlet_events=None):
           for event in inlet_events[AssetAlias("example-alias")]:
               print(event)
   
   
       consume_asset_event_from_asset_alias()`
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Run the above dag in airflow 3.0.2
   
   ### Operating System
   
   Macbook
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### 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] Assets belonging to AssetAlias do not get created and do not show up on Airflow UI [airflow]

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

   cc: @uranusjr 
   
   TP, can you please validate? 


-- 
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] Assets belonging to AssetAlias do not get created and do not show up on Airflow UI [airflow]

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

   Closing, this was fixed in https://github.com/apache/airflow/pull/71555, which will be released in 3.3.2


-- 
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] Assets belonging to AssetAlias do not get created and do not show up on Airflow UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed issue #52438: Assets belonging to AssetAlias do not get created and do not show up on Airflow UI
URL: https://github.com/apache/airflow/issues/52438


-- 
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] Assets belonging to AssetAlias do not show up on Airflow UI [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #52438:
URL: https://github.com/apache/airflow/issues/52438#issuecomment-3016316313

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
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] Assets belonging to AssetAlias do not get created and do not show up on Airflow UI [airflow]

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

   Confirming this is still present in Airflow 3.3.0.
   
   Same pattern as the original report: outlets=[AssetAlias(...)] on a task, with outlet_events[alias].add(Asset(...), extra={...}) inside. airflow assets list (CLI) correctly shows the dynamically-created assets, but GET /api/v2/assets?limit=50&offset=0 (tested directly via curl with a valid bearer token, no query filters) returns {"assets":[],"total_entries":0} — completely empty.
   
   I initially suspected the per-run-changing URI (each run generated a unique file://.../timestamp_report.csv URI) was the cause. I switched to a stable name and stable custom-scheme uri (e.g. x-myapp://included_report), with the actual variable file path moved entirely into extra. Even with a fully stable name+URI pair, GET /api/v2/assets still returns empty for these assets, while airflow assets list (CLI) shows them correctly.
   
   This rules out URI-churn as the cause and points more specifically at the alias→asset link itself not being traversed by the REST API — consistent with the original report here ("the asset alias doesn't have the necessary assets in them"). The downstream scheduling (schedule=alias_a & alias_b on the consumer DAG) continues to work correctly and triggers as expected regardless, so this appears to be purely an API/UI visibility gap, not a core scheduling bug.


-- 
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] Assets belonging to AssetAlias do not get created and do not show up on Airflow UI [airflow]

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

   Can you fix the code block?


-- 
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] Assets belonging to AssetAlias do not get created and do not show up on Airflow UI [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #52438:
URL: https://github.com/apache/airflow/issues/52438#issuecomment-5114709493

   This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.


-- 
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