Skip to content

Show assets materialized from an AssetAlias in the Assets tab - #71555

Merged
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:fix-alias-materialized-assets-inactive
Aug 20, 2026
Merged

pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:fix-alias-materialized-assets-inactive

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

closes: #58058

An asset created at runtime by attaching it to an AssetAlias outlet via Metadata or outlet_events is referenced only through the alias association (asset_alias_asset), not the schedule/outlet/inlet reference tables. The scheduler's asset-orphanage pass (_update_asset_orphanage) therefore counts it as orphaned and never writes an AssetActive row, so the Assets tab — which defaults to only_active — never shows it, even though it has events and a live alias.

This counts the alias association as a reference in the orphanage pass, so an asset attached to a live alias is activated like any other.

Repro dag:

"""
Minimal reproduction for https://github.com/apache/airflow/issues/58058.

A task declares an ``AssetAlias`` outlet and, at runtime, materializes a concrete
asset attached to that alias via ``Metadata``. Before the fix the materialized
asset ("materialized_from_alias_58058") never appears in the Assets tab because it
is only linked through the alias association and is therefore treated as orphaned
(never activated). After the fix it should show up like any other asset once the
producer task has run.
"""

from datetime import datetime, timezone

from airflow.providers.standard.operators.python import PythonOperator
from airflow.sdk import Asset, AssetAlias, Metadata, dag

alias = AssetAlias(name="materialized_alias_58058")


@dag(schedule=None, tags=["test", "58058"])
def repro_58058_producer():
    def produce():
        yield Metadata(
            asset=Asset(name="materialized_from_alias_58058", uri="s3://bucket/58058.csv"),
            extra={"ts": datetime.now(tz=timezone.utc).isoformat()},
            alias=alias,
        )

    PythonOperator(task_id="produce", python_callable=produce, outlets=[alias])


repro_58058_producer()

Dag has a run (that materializes the alias)

Before

Screenshot 2026-08-14 at 13 36 36 Screenshot 2026-08-14 at 13 36 56

After

Screenshot 2026-08-14 at 15 02 53 Screenshot 2026-08-14 at 15 03 17
Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

… Assets tab

An asset created at runtime by attaching it to an AssetAlias outlet via Metadata is
referenced only through the alias association, not the schedule/outlet/inlet tables,
so the asset-orphanage pass treated it as orphaned and never activated it. The Assets
tab defaults to only_active, so the asset (and its alias) never showed up despite
having events. Count the alias association as a reference so such assets are activated
like any other.

Fixes apache#58058.
@pierrejeambrun
pierrejeambrun force-pushed the fix-alias-materialized-assets-inactive branch from 820e29f to 6b8c60e Compare August 13, 2026 15:34
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.2 milestone Aug 14, 2026
@pierrejeambrun
pierrejeambrun marked this pull request as ready for review August 14, 2026 11:34
@pierrejeambrun
pierrejeambrun merged commit 32f8527 into apache:main Aug 20, 2026
219 of 220 checks passed
@pierrejeambrun
pierrejeambrun deleted the fix-alias-materialized-assets-inactive branch August 20, 2026 14:03
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
❌ v3-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 32f8527 v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

pierrejeambrun added a commit that referenced this pull request Aug 21, 2026
… Assets tab (#71555) (#71935)

An asset created at runtime by attaching it to an AssetAlias outlet via Metadata is
referenced only through the alias association, not the schedule/outlet/inlet tables,
so the asset-orphanage pass treated it as orphaned and never activated it. The Assets
tab defaults to only_active, so the asset (and its alias) never showed up despite
having events. Count the alias association as a reference so such assets are activated
like any other.

Fixes #58058.

(cherry picked from commit 32f8527)
vatsrahul1001 pushed a commit that referenced this pull request Sep 7, 2026
… Assets tab (#71555) (#71935)

An asset created at runtime by attaching it to an AssetAlias outlet via Metadata is
referenced only through the alias association, not the schedule/outlet/inlet tables,
so the asset-orphanage pass treated it as orphaned and never activated it. The Assets
tab defaults to only_active, so the asset (and its alias) never showed up despite
having events. Count the alias association as a reference so such assets are activated
like any other.

Fixes #58058.

(cherry picked from commit 32f8527)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AssetAliases are not shown in assets tab

2 participants