You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "foldvari (via GitHub)" <gi...@apache.org> on 2026/04/01 12:03:15 UTC

[I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

foldvari opened a new issue, #64573:
URL: https://github.com/apache/airflow/issues/64573

   ### Apache Airflow version
   
   3.1.8
   
   ### What happened and how to reproduce it?
   
   I am using apache-airflow-client==3.1.6 to get/create/update XCOM value. What I see is that 
   
   -  `create_xcom_entry` works correctly, if a pass a string value, it properly stores that, and `get_xcom_entry` gets back the exact same value.
   - `update_xcom_entry` though quotes to the value, so `get_xcom_entry` gets back the value in quotation marks. I see the same on the UI (Browse/XComs)
   
   Code to reproduce the issue:
   ```python
   def reporduce_the_issue():
       api_client_provider = AirflowApiClientProvider()
       DAG_ID = '_for_testing'
       DAG_RUN_ID = 'manual__2026-03-31T12:59:12.433086+00:00'
       TASK_ID = 'task1'
       XCOM_KEY = random_xcom_key()
       XCOM_VALUE1 = 'test_value1'
       XCOM_VALUE2 = 'test_value2'
   
       with api_client_provider.get_api_client() as api_client:
           xcom_api = airflow_client.client.XComApi(api_client)
   
           log.info('Check that it does not exist yet.')
           try:
               xcom_api.get_xcom_entry(
                   dag_id=DAG_ID,
                   dag_run_id=DAG_RUN_ID,
                   task_id=TASK_ID,
                   xcom_key=XCOM_KEY,
               )
               log.error(f'Random is not random enough, try it again')
               return
           except NotFoundException:
               pass
   
           log.info(f'Create {XCOM_KEY} with value {XCOM_VALUE1}.')
           xcom_api.create_xcom_entry(
               dag_id=DAG_ID,
               dag_run_id=DAG_RUN_ID,
               task_id=TASK_ID,
               x_com_create_body=XComCreateBody(key=XCOM_KEY, value=XCOM_VALUE1)
           )
           log.info('Get the value.')
           xcom_entry = xcom_api.get_xcom_entry(
               dag_id=DAG_ID,
               dag_run_id=DAG_RUN_ID,
               task_id=TASK_ID,
               xcom_key=XCOM_KEY,
           )
           val = xcom_entry.to_dict().get('value')
           log.info(f'Value after creation: {val=}')
   
           log.info(f'Update {XCOM_KEY} with value {XCOM_VALUE2}.')
           xcom_api.update_xcom_entry(
               dag_id=DAG_ID,
               dag_run_id=DAG_RUN_ID,
               task_id=TASK_ID,
               xcom_key=XCOM_KEY,
               x_com_update_body=XComUpdateBody(value=XCOM_VALUE2)
           )
           log.info('Get the value.')
           xcom_entry = xcom_api.get_xcom_entry(
               dag_id=DAG_ID,
               dag_run_id=DAG_RUN_ID,
               task_id=TASK_ID,
               xcom_key=XCOM_KEY,
           )
           val = xcom_entry.to_dict().get('value')
           log.info(f'Value after update: {val=}')
   
   ```
   
   ### What you think should happen instead?
   
   The value should not be changed by the update method. It should not be quoted.
   
   ```
   2026-04-01 11:43:24,459 - __main__ - INFO - Check that it does not exist yet.
   2026-04-01 11:43:24,513 - __main__ - INFO - Create task_ikp517fwfb with value test_value1.
   2026-04-01 11:43:24,561 - __main__ - INFO - Get the value.
   2026-04-01 11:43:24,590 - __main__ - INFO - Value after creation: val='"test_value1"'
   2026-04-01 11:43:24,590 - __main__ - INFO - Update task_ikp517fwfb with value test_value2.
   2026-04-01 11:43:24,624 - __main__ - INFO - Get the value.
   2026-04-01 11:43:24,652 - __main__ - INFO - Value after update: val='"\\"test_value2\\""'
   ```
   
   ### Operating System
   
   Debian GNU/Linux 12 (bookworm)
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow==3.1.8
   apache-airflow-client==3.1.6
   apache-airflow-core==3.1.8
   
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "foldvari (via GitHub)" <gi...@apache.org>.
foldvari commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-4170509081

   @jroachgolf84 
   > Just curious; why are you using `x_com_update_body` rather than `patch_body`? I wasn't able to find `x_com_update_body` in any part of the code base.
   
   I suppose this is coming from apache-airflow-client and based on it's code it is generated:
   
   `airflow_client\client\api\x_com_api.py`
   
   ```python
   # coding: utf-8
   
   """
       Airflow API
   
       Airflow API. All endpoints located under ``/api/v2`` can be used safely, are stable and backward compatible. Endpoints located under ``/ui`` are dedicated to the UI and are subject to breaking change depending on the need of the frontend. Users should not rely on those but use the public ones instead.
   
       The version of the OpenAPI document: 2
       Generated by OpenAPI Generator (https://openapi-generator.tech)
   
       Do not edit the class manually.
   """  # noqa: E501
   
   import ...
   
   
   class XComApi:
       """NOTE: This class is auto generated by OpenAPI Generator
       Ref: https://openapi-generator.tech
   
       Do not edit the class manually.
       """
   ```
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "denncs-tx (via GitHub)" <gi...@apache.org>.
denncs-tx commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-5575592789

   I have confirmed that this issue no longer exists as of Apache Airflow version 3.2.2.
   
   All validation tests / duplication efforts performed as Docker Compose scripts through the execution of an external Python script using "apache-airflow-client==3.1.6" in a separate virtual environment.
   
   Here are the versions that I have verified and their results:
   3.1.8 - Embedded quotes exist
   3.2.0 - Embedded quotes exist
   3.2.1 - Embedded quotes exist
   3.2.2 - Embedded quotes do not exist
   3.3.0 - Embedded quotes do not exist
   3.3.1 - Embedded quotes do not exist
   Open Source "main" branch - Embedded quotes do not exist
   
   Could you reattempt your code with Apache Airflow version 3.2.2 or greater?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-4170119934

   Just curious; why are you using `x_com_update_body` rather than `patch_body`? I wasn't able to find `x_com_update_body` in any part of the code base.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "weiyu1029 (via GitHub)" <gi...@apache.org>.
weiyu1029 commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-5512519372

   Can I contribute to this one?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "denncs-tx (via GitHub)" <gi...@apache.org>.
denncs-tx commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-5512467072

   Can I work on this?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "denncs-tx (via GitHub)" <gi...@apache.org>.
denncs-tx commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-5533691638

   Issue has been duplicated. Will be working through a fix within the next few calendar days.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-4179564597

   If you use `patch_body`, does this resolve the issue?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "shahar1 (via GitHub) via commits" <co...@airflow.apache.org>.
shahar1 closed issue #64573: Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value
URL: https://github.com/apache/airflow/issues/64573


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "shivaam (via GitHub)" <gi...@apache.org>.
shivaam commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-4212934777

   I think this is already fixed on main by #64220 (which closed the related #59032). Should be available in the next release.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-4212945856

   Closing then for testing with 3.2.1 -> @foldvari -> please test when we are announcing 3.2.1rcs


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "denncs-tx (via GitHub)" <gi...@apache.org>.
denncs-tx commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-5697044335

   No response yet on this issue. Is this a candidate for closure?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 3 update_xcom_entry is adding unnecessary quotes to the string value [airflow]

Posted by "shahar1 (via GitHub) via commits" <co...@airflow.apache.org>.
shahar1 commented on issue #64573:
URL: https://github.com/apache/airflow/issues/64573#issuecomment-6686712301

   Solved by https://github.com/apache/airflow/pull/64220,
   @denncs-tx - Thanks for confirming.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org