Skip to content

Deprecate Asset.extra and add Asset.event_extra_template #55200

Open

Description

@uranusjr

Body

Asset.extra was originally designed so users can attach additional useful information to describe an asset. We also designed AssetEvent.extra so when an event is emitted against an asset, it can contain additional data to be used in dags/tasks that are triggered by the event, or read the asset as a data inlet.

However, perhaps due to the very similar name, Asset.extra is constantly being misunderstood as some form of blueprint/template/source to AssetEvent.extra, and key-values defined on the asset should be populated into event extras against the asset.

Combined with the latest attempt to add extra templating (#54885 by @hussein-awala), I feel the confusion is much too significant for this feature. My proposal for the situation is

  1. Deprecate Asset.extra to be removed in 4.0. It is not clear whether a key-value store for static additional information is useful. Dags don’t have it, and people don’t seem to be too bothered. We can probably add doc_md etc. if needed.
  2. Add Asset.event_extra_template to re-implement Support templated extra in outlets assets #54885. Clearer name, no backward compatibility consideration needed.

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Activity

  1. added
    area:data-aware-scheduling
    on Sep 3, 2025
  2. Brunda10 commented on Sep 3, 2025

    @Brunda10
    Contributor

    Hi I would like to work on this issue. Please assign it to me.

  3. added this to the Airflow 3.1.0 milestone on Sep 3, 2025
  4. Lee-W commented on Sep 3, 2025

    @Lee-W
    Member

    Deprecate Asset.extra to be removed in 4.0. It is not clear whether a key-value store for static additional information is useful. Dags don’t have it, and people don’t seem to be too bothered. We can probably add doc_md etc. if needed.

    I'm thinking of something like Asset.description (str). Can't think of other use cases other than description here 🤔

  5. kaxil commented on Sep 3, 2025

    @kaxil
    Member

    If I want to mark an Asset as sensitive/containing PII via attaching some metadata, what would be the recommended way.

  6. uranusjr commented on Sep 3, 2025

    @uranusjr
    MemberAuthor

    Hmm. What would you do that for a dag or a task? We can do the same on an asset.

  7. kaxil commented on Sep 3, 2025

    @kaxil
    Member

    Hmm. What would you do that for a dag or a task? We can do the same on an asset.

    I'd say it is similar it adding a tag on the dag object -- so all dagruns are associated to same tag (via the dag)

  8. Brunda10 commented on Sep 4, 2025

    @Brunda10
    Contributor

    In DAGs and tasks, we generally use doc_md (or doc) for human-readable descriptions, and tags when we want to classify things (e.g. mark something as pii or sensitive).Ref Link

    If we want assets to stay consistent with that model, it sounds reasonable :
    • Asset.description – for freeform text, same as doc_md
    • Asset.tags – for lightweight classification, similar to DAG/Task tags
    • Asset.event_extra_template – for dynamic, event-time metadata

    This way assets follow the same model as DAGs and tasks, while also avoiding the confusion around extra.

  9. hussein-awala commented on Sep 4, 2025

    @hussein-awala
    Member

    I agree, this is confusing for me and for many other users.

    I saw a PR to revert the PR that added support for rendering the extra. Do you think it would be possible to implement your suggestion before releasing 3.1.0?

  10. uranusjr commented on Sep 5, 2025

    @uranusjr
    MemberAuthor

    Let’s do the event_extra_template thing first for 3.1.0; the rest is less important. Feel free to start working on it, I’m going to be working on task sdk for a while before I get to this.

  11. added
    priority:medium
    on Nov 5, 2025
  12. 3 remaining items

  13. ninsbl commented on Jun 22, 2026

    @ninsbl
    Contributor

    In my setup, I use Asset.extra quite extensive to centralize some metadata for an asset
    This is both metadata for human consumers (like e.g. description, ...). But also metadata ment to be used in processing (like where the Asset files are stored, versions, related service URLs, ...). That way I do not have to define that kind of metadata in DAG code, but rather get it from the asset itself, and I have a pydantic model for required asset.extra content in my DAGs.
    So, to me Asset.extra seems quite understandable and actually very useful.

  14. uranusjr commented on Jul 2, 2026

    @uranusjr
    MemberAuthor

    Do you read the asset extra in Airflow? If so, how? The reason this is considered less than useful is it is structured metadata that does not actually offer anything useful for Airflow (including user code). We have other means to provide information for human consumption, such as description and doc_md that are more similar to DAG and also cause less confusion.

  15. ninsbl commented on Jul 2, 2026

    @ninsbl
    Contributor

    Do you read the asset extra in Airflow? If so, how?

    As background information: I use Apache Airflow for processing satellite data.
    I built a (pydantic) model for my assets, that I use to store a bunch of constants that not only contain information for human consumption, but also are used in standardized DAG logic. To access it I wrote an asset-module from which DAGs import a get_asset function that is used to fetch outlet and inlet assets using their names. Constants like: platform, spacecraft, processing_level, processing_baseline, product_type, sensor, sensor mode, bands are constants that become valuable for processing the data, in addition to URLs and other references in the user facing storage and provisioning systems. For example, we inject the satellite images into both a server for image provisioning and another platform for processing. Both systems use overlaping metadata for dataset, and since everything is orchestrated with Airflow anyways, we found it more natural to make Assets in Airflow the main source of all that metadata. Of course I can store all that information other places, like e.g. a python module associated with the DAG code. However, I figured the Assets to be a central element of both data processing and and human thinking that. And from the Asset.extra, Airflow can push the metadata to all our end-user facing systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:corearea:data-aware-schedulingkind:featurepriority:medium

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions