pierrejeambrun commented on code in PR #58344:
URL: https://github.com/apache/airflow/pull/58344#discussion_r2607457530
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_xcom.py:
##########
@@ -646,6 +659,24 @@ def test_should_respond_403(self,
unauthorized_test_client):
)
assert response.status_code == 403
+ def test_create_xcom_entry_with_slash_key(self, test_client):
+ slash_key = "a/b/c"
+ body = XComCreateBody(key=slash_key, value=TEST_XCOM_VALUE)
+ response = test_client.post(
+
f"/dags/{TEST_DAG_ID}/dagRuns/{run_id}/taskInstances/{TEST_TASK_ID}/xcomEntries",
+ json=body.dict(),
+ )
+ assert response.status_code == 201
+ assert response.json()["key"] == slash_key
+ # Verify retrieval via encoded path
+ encoded_key = quote(slash_key, safe="")
Review Comment:
You don't need those. The test client does the encoding.
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py:
##########
@@ -257,7 +257,7 @@ def create_xcom_entry(
)
try:
- value = json.dumps(request_body.value)
+ value = XComModel.serialize_value(request_body.value)
Review Comment:
This change shouldn't be. It was purposely done in #58900
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_xcom.py:
##########
@@ -673,7 +704,7 @@ def test_patch_xcom_entry(self, key, patch_body,
expected_status, expected_detai
# Ensure the XCom entry exists before updating
if expected_status != 404:
self._create_xcom(TEST_XCOM_KEY, TEST_XCOM_VALUE)
- new_value = XComModel.serialize_value(patch_body["value"])
+ expected_value = XComModel.serialize_value(patch_body["value"])
Review Comment:
Why change that?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]