henry3260 commented on code in PR #58344:
URL: https://github.com/apache/airflow/pull/58344#discussion_r2532667465
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_xcom.py:
##########
@@ -161,6 +162,18 @@ def test_should_raise_404_for_non_existent_xcom(self,
test_client):
assert response.status_code == 404
assert response.json()["detail"] == f"XCom entry with key:
`{TEST_XCOM_KEY_2}` not found"
+ def test_should_respond_200_native_with_slash_key(self, test_client):
+ slash_key = "folder/sub/value"
+ self._create_xcom(slash_key, TEST_XCOM_VALUE)
+ encoded_key = quote(slash_key, safe="")
+ response = test_client.get(
+
f"/dags/{TEST_DAG_ID}/dagRuns/{run_id}/taskInstances/{TEST_TASK_ID}/xcomEntries/{encoded_key}"
Review Comment:
Yes, you are right! Yes, because I use
[{xcom_key:path}](vscode-file://vscode-app/c:/Users/Henry%20Chen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
in the route definition, we can directly use
`/dags/my_Dag/dagRuns/run_1/taskInstances/task_1/xcomEntries/folder/sub/value
`without encoding.
--
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]