Skip to content

Commit

Permalink
Fix SQLite condition for detecting pickled data (apache#44611)
Browse files Browse the repository at this point in the history
In [PR](apache#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](apache#44533 (comment)).

related: apache#44166
  • Loading branch information
vatsrahul1001 authored Dec 3, 2024
1 parent c0ca2d7 commit 40821bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/img/airflow_erd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b42b04b6cc47650cb9e7a37258a6e8e99bdca2677253715505b8ad287192bf72
3784bc5f7a8a5d39b5b757e6e07e5026b9c5d4fc978510f435ff64f4c9154f13

0 comments on commit 40821bf

Please sign in to comment.