airflow.models.xcom

Module Contents

Classes

BaseXCom

Base class for XCom objects.

Functions

resolve_xcom_backend() → Type[BaseXCom]

Resolves custom XCom class

Attributes

log

MAX_XCOM_SIZE

XCOM_RETURN_KEY

XCom

airflow.models.xcom.log[source]
airflow.models.xcom.MAX_XCOM_SIZE = 49344[source]
airflow.models.xcom.XCOM_RETURN_KEY = return_value[source]
class airflow.models.xcom.BaseXCom(context=None)[source]

Bases: airflow.models.base.Base, airflow.utils.log.logging_mixin.LoggingMixin

Base class for XCom objects.

__tablename__ = xcom[source]
key[source]
value[source]
timestamp[source]
execution_date[source]
task_id[source]
dag_id[source]
dag_run[source]
run_id[source]
init_on_load(self)[source]

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.

__repr__(self)[source]

Return repr(self).

classmethod delete(cls, xcoms: Union[XCom, Iterable[XCom]], session: sqlalchemy.orm.Session) None[source]

Delete one or multiple XCom entries.

static serialize_value(value: Any)[source]

Serialize Xcom value to str or pickled object

static deserialize_value(result: XCom) Any[source]

Deserialize XCom value from str or pickle object

orm_deserialize_value(self) Any[source]

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.

airflow.models.xcom.resolve_xcom_backend() Type[BaseXCom][source]

Resolves custom XCom class

airflow.models.xcom.XCom[source]

Was this entry helpful?