You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit adb32ed
Browse filesBrowse the repository at this point in the historyBrowse files
Add static analysis tests for migration anti-patterns
Prevent migration bugs like apache#64876 (DML before disable_sqlite_fkeys
silently breaking SQLite PRAGMA) from reaching production by adding:
1. AST-based static analysis tests (test_migration_patterns.py) that
detect three anti-patterns across all migration files:
- MIG001: DML before disable_sqlite_fkeys (triggers autobegin)
- MIG002: DDL before disable_sqlite_fkeys (triggers autobegin)
- MIG003: DML without context.is_offline_mode() guard
2. Unit tests for migration utility functions (test_migration_utils.py)
covering disable_sqlite_fkeys, mysql_drop_foreignkey_if_exists, and
ignore_sqlite_value_error with real database backends.
3. Fixes confirmed SQLite PRAGMA bugs in migrations 0100 and 0106 by
moving all operations inside the disable_sqlite_fkeys block.
4. Adds # noqa: MIG0XX suppression comments (with reasons) to 20 old
migrations with acknowledged violations, and configures ruff to
preserve them via external = ["MIG"].
Copy file name to clipboardExpand all lines: airflow-core/src/airflow/migrations/versions/0027_2_10_3_fix_dag_schedule_dataset_alias_reference_naming.py
0 commit comments