saitejabandaru-in opened a new pull request, #71964:
URL: https://github.com/apache/airflow/pull/71964

   Closes #71921.
   
   ### Motivation
   
   When `0049_3_0_0_remove_pickled_data_from_xcom_table` runs, its sanitization 
logic for non-finite floats replaces `NaN`, `Infinity`, and `-Infinity` with 
quoted strings like `"NaN"`. While this produces valid JSON when the float is 
at the top-level of the JSON document, it breaks when the float is embedded 
deeply in a stringified JSON document (i.e. doubly-JSON-encoded, like 
`{"report": "{\"amount\": NaN}"}`). Injecting unescaped quotes inside an 
already encoded string prematurely terminates the string, causing subsequent 
casting to JSONB to fail, crashing the Airflow deployment upgrade loop entirely.
   
   ### Changes
   
   - Updated `_XCOM_PG_SANITIZE_SQL`, `_XCOM_MYSQL_SANITIZE_SQL`, and 
`_XCOM_SQLITE_SANITIZE_SQL` to replace non-finite tokens with the bare literal 
`null` instead of `"$2"`.
   - `null` requires no escaping and is syntactically valid JSON at any nesting 
depth, solving the corruption.
   - Updated `test_0049_remove_pickled_data_from_xcom_table.py` expectations to 
assert `None` values.


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