Skip to content

Commit

Permalink
Document overriding XCom.clear for data lifecycle management (apa…
Browse files Browse the repository at this point in the history
…che#17589)

This was added in apache#17405 but was not documented
  • Loading branch information
kaxil authored Aug 12, 2021
1 parent 8b03d9d commit 113bfdf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/apache-airflow/concepts/xcoms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ The XCom system has interchangeable backends, and you can set which backend is b
If you want to implement your own backend, you should subclass :class:`~airflow.models.xcom.BaseXCom`, and override the ``serialize_value`` and ``deserialize_value`` methods.

There is also an ``orm_deserialize_value`` method that is called whenever the XCom objects are rendered for UI or reporting purposes; if you have large or expensive-to-retrieve values in your XComs, you should override this method to avoid calling that code (and instead return a lighter, incomplete representation) so the UI remains responsive.

You can also override the ``clear`` method and use it when clearing results for given dags and tasks. This allows the custom XCom backend process the data lifecycle easier.

0 comments on commit 113bfdf

Please sign in to comment.