dhkim1920 opened a new pull request, #71442:
URL: https://github.com/apache/airflow/pull/71442

   PostgreSQL accepts `\u0000` escapes in `JSON`, but rejects them when 
migration 0089 casts `serialized_dag.data` to `JSONB`. This blocks upgrades 
from Airflow 3.1 when a serialized Dag contains a NUL character.
   
   This draft applies the sanitization approach established by 
[#69064](https://github.com/apache/airflow/pull/69064) to migration 0089:
   
   - protect escaped backslashes so literal `\u0000` text is preserved;
   - strip active U+0000 escapes before the JSONB cast;
   - add a PostgreSQL regression test covering both cases.
   
   ## Decision needed
   
   #69064 strips U+0000 from historical XCom and DagRun data because PostgreSQL 
JSONB cannot represent it. Applying the same policy to `serialized_dag` is 
semantically different: a delimiter such as `"@@\0@@"` becomes `"@@@@"`, 
changing the Dag definition.
   
   This draft asks whether lossy sanitization is acceptable for this migration 
or whether serialized Dag data needs a different policy. Migration-only 
sanitization may also not address a later reserialization of the same Dag into 
JSONB, so the final scope depends on that policy decision.
   
   closes: #65379
   
   ## Tests
   
   - `breeze run --backend postgres pytest 
airflow-core/tests/unit/migrations/test_0089_change_serialized_dag_data_column_to_jsonb.py
 -xvs`
   - `prek run --from-ref main --stage pre-commit`
   - `prek run --from-ref main --stage manual --skip compile-ui-assets-dev 
--skip view-skill-eval`
   - `breeze testing core-tests --run-in-parallel`
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Codex (GPT-5.6)
   
   Generated-by: Codex (GPT-5.6) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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