This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 40821bfd5c5 Fix SQLite condition for detecting pickled data (#44611)
40821bfd5c5 is described below

commit 40821bfd5c54f3a39b3ff6e8352a4e3a20323e24
Author: vatsrahul1001 <[email protected]>
AuthorDate: Tue Dec 3 20:33:02 2024 +0530

    Fix SQLite condition for detecting pickled data (#44611)
    
    In [PR](https://github.com/apache/airflow/pull/44166) we added migration 
for removing pickled data from `xcom` table. During my testing I noticed with 
`SQLite`  
[insert](https://github.com/apache/airflow/blob/main/airflow/migrations/versions/0049_3_0_0_remove_pickled_data_from_xcom_table.py#L88)
 statement is not working in case of upgrade. Changing condition to 
`hex(substr(value, 1, 1)) = '80'` works. Tested 
[here](https://github.com/apache/airflow/pull/44533#discussion_r1867742628).
    
    related: https://github.com/apache/airflow/pull/44166
---
 .../versions/0049_3_0_0_remove_pickled_data_from_xcom_table.py          | 2 +-
 docs/apache-airflow/img/airflow_erd.sha256                              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/airflow/migrations/versions/0049_3_0_0_remove_pickled_data_from_xcom_table.py 
b/airflow/migrations/versions/0049_3_0_0_remove_pickled_data_from_xcom_table.py
index ed3379ef51b..c3972edbd12 100644
--- 
a/airflow/migrations/versions/0049_3_0_0_remove_pickled_data_from_xcom_table.py
+++ 
b/airflow/migrations/versions/0049_3_0_0_remove_pickled_data_from_xcom_table.py
@@ -71,7 +71,7 @@ def upgrade():
     condition_templates = {
         "postgresql": "get_byte(value, 0) = 128",
         "mysql": "HEX(SUBSTRING(value, 1, 1)) = '80'",
-        "sqlite": "substr(value, 1, 1) = char(128)",
+        "sqlite": "hex(substr(value, 1, 1)) = '80'",
     }
 
     condition = condition_templates.get(dialect)
diff --git a/docs/apache-airflow/img/airflow_erd.sha256 
b/docs/apache-airflow/img/airflow_erd.sha256
index 4987e63b9bb..f1c65f2e245 100644
--- a/docs/apache-airflow/img/airflow_erd.sha256
+++ b/docs/apache-airflow/img/airflow_erd.sha256
@@ -1 +1 @@
-b42b04b6cc47650cb9e7a37258a6e8e99bdca2677253715505b8ad287192bf72
\ No newline at end of file
+3784bc5f7a8a5d39b5b757e6e07e5026b9c5d4fc978510f435ff64f4c9154f13
\ No newline at end of file

Reply via email to