You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecate Asset.extra and add Asset.event_extra_template #55200
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
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.
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 🤔
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.
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?
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.
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.
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.
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.
Activity
Brunda10 commentedon Sep 3, 2025
Hi I would like to work on this issue. Please assign it to me.
Lee-W commentedon Sep 3, 2025
I'm thinking of something like
Asset.description(str). Can't think of other use cases other than description here 🤔kaxil commentedon Sep 3, 2025
If I want to mark an Asset as sensitive/containing PII via attaching some metadata, what would be the recommended way.
uranusjr commentedon Sep 3, 2025
Hmm. What would you do that for a dag or a task? We can do the same on an asset.
kaxil commentedon Sep 3, 2025
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)
Brunda10 commentedon Sep 4, 2025
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.
hussein-awala commentedon Sep 4, 2025
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?
uranusjr commentedon Sep 5, 2025
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.
3 remaining items
ninsbl commentedon Jun 22, 2026
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.
uranusjr commentedon Jul 2, 2026
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
descriptionanddoc_mdthat are more similar toDAGand also cause less confusion.ninsbl commentedon Jul 2, 2026
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.