Skip to content

DAG dependencies not showing up for When Asset Alias are used #49102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
vatsrahul1001 opened this issue Apr 11, 2025 · 2 comments · Fixed by #49204
Closed
1 of 2 tasks

DAG dependencies not showing up for When Asset Alias are used #49102

vatsrahul1001 opened this issue Apr 11, 2025 · 2 comments · Fixed by #49204
Assignees
Labels
affected_version:3.0.0rc For all 3.0.0 release candidates area:core kind:bug This is a clearly a bug priority:high High priority bug that should be patched quickly but does not require immediate new release

Comments

@vatsrahul1001
Copy link
Contributor

Apache Airflow version

3.0.0

If "Other Airflow 2 version" selected, which one?

No response

What happened?

In the case of asset aliases, if there are no DAG runs, the dependencies are not displayed in the graph. Once a DAG run occurs, the DAG dependencies become visible.

Before DAG RUN:

Image

After DAG RUN:

Image

What you think should happen instead?

No response

How to reproduce

  1. Check graph of below DAG without a DAGRUN no dependencies are shown
  2. Make a DAGRUN and check again
from __future__ import annotations

import pendulum

from airflow.sdk import DAG, Asset, AssetAlias, task

with DAG(
    dag_id="asset_s3_bucket_producer",
    start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
    schedule=None,
    catchup=False,
    tags=["producer", "asset"],
):

    @task(outlets=[Asset("s3://bucket/my-task")])
    def produce_asset_events():
        pass

    produce_asset_events()

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"
        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_s3_bucket_consumer",
    start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
    schedule=[Asset("s3://bucket/my-task")],
    catchup=False,
    tags=["consumer", "asset"],
):

    @task
    def consume_asset_event():
        pass

    consume_asset_event()

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

Operating System

linux

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

@vatsrahul1001 vatsrahul1001 added affected_version:3.0.0rc For all 3.0.0 release candidates area:core kind:bug This is a clearly a bug priority:high High priority bug that should be patched quickly but does not require immediate new release labels Apr 11, 2025
@uranusjr
Copy link
Member

Is this related to #49008 @Lee-W?

@Lee-W
Copy link
Member

Lee-W commented Apr 12, 2025

more related to #49104, I think. But yes, will take a look. should be a quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected_version:3.0.0rc For all 3.0.0 release candidates area:core kind:bug This is a clearly a bug priority:high High priority bug that should be patched quickly but does not require immediate new release
Projects
None yet
3 participants