You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/01/15 10:18:56 UTC
[airflow] branch master updated: Bugfix: Return XCom Value in the
XCom Endpoint API (#13684)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new dc80fa4 Bugfix: Return XCom Value in the XCom Endpoint API (#13684)
dc80fa4 is described below
commit dc80fa4cbc070fc6e84fcc95799d185badebaa71
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Fri Jan 15 10:18:44 2021 +0000
Bugfix: Return XCom Value in the XCom Endpoint API (#13684)
* Bugfix: Return XCom Value in the XCom Endpoint API
closes https://github.com/apache/airflow/issues/13676
---
airflow/api_connexion/endpoints/xcom_endpoint.py | 4 ++--
airflow/api_connexion/openapi/v1.yaml | 3 ++-
tests/api_connexion/endpoints/test_xcom_endpoint.py | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/airflow/api_connexion/endpoints/xcom_endpoint.py b/airflow/api_connexion/endpoints/xcom_endpoint.py
index b49f155..9740efd 100644
--- a/airflow/api_connexion/endpoints/xcom_endpoint.py
+++ b/airflow/api_connexion/endpoints/xcom_endpoint.py
@@ -27,8 +27,8 @@ from airflow.api_connexion.schemas.xcom_schema import (
XComCollection,
XComCollectionItemSchema,
XComCollectionSchema,
- xcom_collection_item_schema,
xcom_collection_schema,
+ xcom_schema,
)
from airflow.models import DagRun as DR, XCom
from airflow.security import permissions
@@ -94,4 +94,4 @@ def get_xcom_entry(
query_object = query.one_or_none()
if not query_object:
raise NotFound("XCom entry not found")
- return xcom_collection_item_schema.dump(query_object)
+ return xcom_schema.dump(query_object)
diff --git a/airflow/api_connexion/openapi/v1.yaml b/airflow/api_connexion/openapi/v1.yaml
index 760a662..ff2fb5a 100644
--- a/airflow/api_connexion/openapi/v1.yaml
+++ b/airflow/api_connexion/openapi/v1.yaml
@@ -1086,7 +1086,8 @@ paths:
summary: List XCom entries
description:
This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCOM entries for
- for all DAGs, DAG runs and task instances.
+ for all DAGs, DAG runs and task instances. XCom values won't be returned as they can be large.
+ Use this endpoint to get a list of XCom entries and then fetch individual entry to get value.
x-openapi-router-controller: airflow.api_connexion.endpoints.xcom_endpoint
operationId: get_xcom_entries
tags: [XCom]
diff --git a/tests/api_connexion/endpoints/test_xcom_endpoint.py b/tests/api_connexion/endpoints/test_xcom_endpoint.py
index 92ef069..95ce05e 100644
--- a/tests/api_connexion/endpoints/test_xcom_endpoint.py
+++ b/tests/api_connexion/endpoints/test_xcom_endpoint.py
@@ -115,6 +115,7 @@ class TestGetXComEntry(TestXComEndpoint):
'key': xcom_key,
'task_id': task_id,
'timestamp': 'TIMESTAMP',
+ 'value': 'TEST_VALUE',
},
)