blob: 2ad2b54bab36905e01d04f35fae43fd6f0a697da [file] [log] [blame]
:py:mod:`airflow.models.xcom`
=============================
.. py:module:: airflow.models.xcom
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.models.xcom.BaseXCom
Functions
~~~~~~~~~
.. autoapisummary::
airflow.models.xcom.resolve_xcom_backend
Attributes
~~~~~~~~~~
.. autoapisummary::
airflow.models.xcom.log
airflow.models.xcom.MAX_XCOM_SIZE
airflow.models.xcom.XCOM_RETURN_KEY
airflow.models.xcom.XCom
.. py:data:: log
.. py:data:: MAX_XCOM_SIZE
:annotation: = 49344
.. py:data:: XCOM_RETURN_KEY
:annotation: = return_value
.. py:class:: BaseXCom(context=None)
Bases: :py:obj:`airflow.models.base.Base`, :py:obj:`airflow.utils.log.logging_mixin.LoggingMixin`
Base class for XCom objects.
.. py:attribute:: __tablename__
:annotation: = xcom
.. py:attribute:: key
.. py:attribute:: value
.. py:attribute:: timestamp
.. py:attribute:: execution_date
.. py:attribute:: task_id
.. py:attribute:: dag_id
.. py:attribute:: dag_run
.. py:attribute:: run_id
.. py:method:: init_on_load(self)
Called by the ORM after the instance has been loaded from the DB or otherwise reconstituted
i.e automatically deserialize Xcom value when loading from DB.
.. py:method:: __repr__(self)
Return repr(self).
.. py:method:: delete(cls, xcoms: Union[XCom, Iterable[XCom]], session: sqlalchemy.orm.Session) -> None
:classmethod:
Delete one or multiple XCom entries.
.. py:method:: serialize_value(value: Any)
:staticmethod:
Serialize Xcom value to str or pickled object
.. py:method:: deserialize_value(result: XCom) -> Any
:staticmethod:
Deserialize XCom value from str or pickle object
.. py:method:: orm_deserialize_value(self) -> Any
Deserialize method which is used to reconstruct ORM XCom object.
This method should be overridden in custom XCom backends to avoid
unnecessary request or other resource consuming operations when
creating XCom orm model. This is used when viewing XCom listing
in the webserver, for example.
.. py:function:: resolve_xcom_backend() -> Type[BaseXCom]
Resolves custom XCom class
.. py:data:: XCom