-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Labels
area:corekind:metaHigh-level information important to the communityHigh-level information important to the community
Milestone
Description
Body
Core API for xcom get used serde deserialize: https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py#L102-L116.
The api is called with deserialize(full=False) which only means stringification.
def deserialize(o: T | None, full=True, type_hint: Any = None) -> object:
"""
Deserialize an object of primitive type and uses an allow list to determine if a class can be loaded.
:param o: primitive to deserialize into an arbitrary object.
:param full: if False it will return a stringified representation
of an object and will not load any classesFor example:
This is my task:
@task
def task_b():
return V1Pod(
metadata=V1ObjectMeta(name="example-pod"),
spec=V1PodSpec(
containers=[
V1Container(
name="example-container",
image="busybox",
command=["sleep", "3600"],
)
]
),
)API returns:
kubernetes.client.models.v1_pod.V1Pod@version=1(spec={'containers': [{'name': 'example-container', 'image': 'busybox', 'command': ['sleep', '3600']}]},metadata={'name': 'example-pod'})Since this is the case, core airflow can do well enough with only stringification code in it without whole library.
Committer
- I acknowledge that I am a maintainer/committer of the Apache Airflow project.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:corekind:metaHigh-level information important to the communityHigh-level information important to the community