This is an automated email from the ASF dual-hosted git repository.
turbaszek 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 7888145 Remove XCom CUD endpoints (#9661)
7888145 is described below
commit 7888145fd8696e45daca206291c50b1af8fc1e7d
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Mon Jul 6 15:31:05 2020 +0100
Remove XCom CUD endpoints (#9661)
---
airflow/api_connexion/endpoints/xcom_endpoint.py | 21 -------
airflow/api_connexion/openapi/v1.yaml | 70 ----------------------
.../api_connexion/endpoints/test_xcom_endpoint.py | 28 ---------
3 files changed, 119 deletions(-)
diff --git a/airflow/api_connexion/endpoints/xcom_endpoint.py
b/airflow/api_connexion/endpoints/xcom_endpoint.py
index ff310c5..13dff43 100644
--- a/airflow/api_connexion/endpoints/xcom_endpoint.py
+++ b/airflow/api_connexion/endpoints/xcom_endpoint.py
@@ -29,13 +29,6 @@ from airflow.models import DagRun as DR, XCom
from airflow.utils.session import provide_session
-def delete_xcom_entry():
- """
- Delete an XCom entry
- """
- raise NotImplementedError("Not implemented yet.")
-
-
@format_parameters({
'limit': check_limit
})
@@ -92,17 +85,3 @@ def get_xcom_entry(
if not query_object:
raise NotFound("XCom entry not found")
return xcom_collection_item_schema.dump(query_object)
-
-
-def patch_xcom_entry():
- """
- Update an XCom entry
- """
- raise NotImplementedError("Not implemented yet.")
-
-
-def post_xcom_entries():
- """
- Create an XCom entry
- """
- raise NotImplementedError("Not implemented yet.")
diff --git a/airflow/api_connexion/openapi/v1.yaml
b/airflow/api_connexion/openapi/v1.yaml
index 970b7d5..6b78d16 100644
--- a/airflow/api_connexion/openapi/v1.yaml
+++ b/airflow/api_connexion/openapi/v1.yaml
@@ -841,31 +841,6 @@ paths:
'403':
$ref: '#/components/responses/PermissionDenied'
- post:
- summary: Create an XCom entry
- x-openapi-router-controller:
airflow.api_connexion.endpoints.xcom_endpoint
- operationId: post_xcom_entries
- tags: [XCom]
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/XCom'
- responses:
- '200':
- description: Successful response.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/XCom'
- '400':
- $ref: '#/components/responses/BadRequest'
- '401':
- $ref: '#/components/responses/Unauthenticated'
- '403':
- $ref: '#/components/responses/PermissionDenied'
-
/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}:
parameters:
- $ref: '#/components/parameters/DAGID'
@@ -892,51 +867,6 @@ paths:
'404':
$ref: '#/components/responses/NotFound'
- patch:
- summary: Update an XCom entry
- x-openapi-router-controller:
airflow.api_connexion.endpoints.xcom_endpoint
- operationId: patch_xcom_entry
- tags: [XCom]
- parameters:
- - $ref: '#/components/parameters/UpdateMask'
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/XCom'
-
- responses:
- '200':
- description: Successful response.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/XCom'
- '400':
- $ref: '#/components/responses/BadRequest'
- '401':
- $ref: '#/components/responses/Unauthenticated'
- '403':
- $ref: '#/components/responses/PermissionDenied'
- '404':
- $ref: '#/components/responses/NotFound'
-
- delete:
- summary: Delete an XCom entry
- x-openapi-router-controller:
airflow.api_connexion.endpoints.xcom_endpoint
- operationId: delete_xcom_entry
- tags: [XCom]
- responses:
- '204':
- description: No content.
- '400':
- $ref: '#/components/responses/BadRequest'
- '401':
- $ref: '#/components/responses/Unauthenticated'
- '403':
- $ref: '#/components/responses/PermissionDenied'
-
# Non-database resources
/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links:
parameters:
diff --git a/tests/api_connexion/endpoints/test_xcom_endpoint.py
b/tests/api_connexion/endpoints/test_xcom_endpoint.py
index ad29cc2..1affd9d 100644
--- a/tests/api_connexion/endpoints/test_xcom_endpoint.py
+++ b/tests/api_connexion/endpoints/test_xcom_endpoint.py
@@ -16,7 +16,6 @@
# under the License.
import unittest
-import pytest
from parameterized import parameterized
from airflow.models import DagRun as DR, XCom
@@ -53,15 +52,6 @@ class TestXComEndpoint(unittest.TestCase):
self.clean_db()
-class TestDeleteXComEntry(TestXComEndpoint):
- @pytest.mark.skip(reason="Not implemented yet")
- def test_should_response_200(self):
- response = self.client.delete(
-
"/dags/TEST_DAG_ID/taskInstances/TEST_TASK_ID/2005-04-02T00:00:00Z/xcomEntries/XCOM_KEY"
- )
- assert response.status_code == 204
-
-
class TestGetXComEntry(TestXComEndpoint):
@provide_session
@@ -245,21 +235,3 @@ class TestPaginationGetXComEntries(TestXComEndpoint):
dag_id=self.dag_id,
timestamp=self.execution_date_parsed,
) for i in range(1, count + 1)]
-
-
-class TestPatchXComEntry(TestXComEndpoint):
- @pytest.mark.skip(reason="Not implemented yet")
- def test_should_response_200(self):
- response = self.client.patch(
-
"/dags/TEST_DAG_ID/taskInstances/TEST_TASK_ID/2005-04-02T00:00:00Z/xcomEntries"
- )
- assert response.status_code == 200
-
-
-class TestPostXComEntry(TestXComEndpoint):
- @pytest.mark.skip(reason="Not implemented yet")
- def test_should_response_200(self):
- response = self.client.post(
-
"/dags/TEST_DAG_ID/taskInstances/TEST_TASK_ID/2005-04-02T00:00:00Z/xcomEntries/XCOM_KEY"
- )
- assert response.status_code == 200