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
Copy file name to clipboardExpand all lines: airflow-core/docs/authoring-and-scheduling/assets.rst
+6-55Lines changed: 6 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,59 +90,6 @@ The identifier does not have to be absolute; it can be a scheme-less, relative U
90
90
91
91
Non-absolute identifiers are considered plain strings that do not carry any semantic meanings to Airflow.
92
92
93
-
Extra information on assets
94
-
----------------------------
95
-
96
-
If needed, you can include an additional dictionary in an asset using the ``extra`` parameter:
97
-
98
-
.. code-block:: python
99
-
100
-
example_asset = Asset(
101
-
"s3://asset/example.csv",
102
-
extra={"team": "trainees"},
103
-
)
104
-
105
-
This allows you to provide custom metadata about the asset, such as ownership information or the purpose of the file. The ``extra`` field does **NOT** affect the identity of an asset.
106
-
Thus, maintaining the uniqueness of the ``extra`` value is the user responsibility. It suggested to have only one single set of ``extra`` value per asset.
107
-
108
-
For example, in the following snippet, only one of the ``extra`` dictionaries will ultimately be stored, but it does guaranteed which one will be stored.
109
-
110
-
.. code-block:: python
111
-
112
-
Asset("s3://asset/example.csv", extra={"d": "e"})
113
-
Asset("s3://asset/example.csv", extra={"f": "g"})
114
-
115
-
This behavior also applies to dynamically generated assets created through ``AssetAlias``.
116
-
In the example below, the final stored ``extra`` value is not guaranteed and it might vary based on Dag processor settings.
# It's not guaranteed which extra will be the one stored
145
-
146
93
Security Warnings
147
94
----------------------------
148
95
@@ -193,8 +140,7 @@ Attaching extra information to an emitting asset event
193
140
194
141
.. versionadded:: 2.10.0
195
142
196
-
A task with an asset outlet can optionally attach extra information before it emits an asset event. This is different
197
-
from `Extra information on assets`_. Extra information on an asset statically describes the entity pointed to by the asset URI; extra information on the *asset event* instead should be used to annotate the triggering data change, such as how many rows in the database are changed by the update, or the date range covered by it.
143
+
A task with an asset outlet can optionally attach extra information before it emits an asset event.
198
144
199
145
The easiest way to attach extra information to the asset event is by ``yield``-ing a ``Metadata`` object from a task:
200
146
@@ -225,6 +171,11 @@ There's minimal magic here---Airflow simply writes the yielded values to the exa
225
171
226
172
.. note:: Asset event extra information can only contain JSON-serializable values (list and dict nesting is possible). This is due to the value being stored in the database.
227
173
174
+
.. versionchanged:: 3.2.0
175
+
176
+
Assets may also contain an extra dict, which is static information distinct from event extras.
177
+
This was considered confusing, has been deprecated, and will be removed in Airflow 4.
0 commit comments