kaxil commented on code in PR #46719:
URL: https://github.com/apache/airflow/pull/46719#discussion_r1956499001


##########
airflow/api_fastapi/execution_api/routes/xcoms.py:
##########
@@ -175,7 +160,7 @@ def set_xcom(
     task_id: str,
     key: str,
     value: Annotated[
-        str,
+        JsonValue,

Review Comment:
   fyi: We would still have multiple serialization/ de-serialization (after 
eliminating 1 step in this PR) steps that we should consolidate -- even after 
this PR.
   
   **Storing Data** (for GO-client example):
   
   1. Go serializes the object (json.Marshal) → Sends it as an HTTP request.
   2. FastAPI deserializes it (JsonValue) → Converts it into a Python dict.
   3. SQLAlchemy stores it (Column(JSON)) → Serializes it back into JSON in the 
database.
   
   
https://github.com/apache/airflow/blob/8f63b828ace09b1095229f22b0c6d1f0f85ea81a/airflow/models/xcom.py#L83
   
   
   
   
   
   **Retrieving Data**:
   
   1. SQLAlchemy loads it as a Python dict from the DB.
   2. FastAPI serializes it back into JSON.
   3. Go receives it and deserializes it (`json.Unmarshal` or a different 
library).



-- 
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]

Reply via email to