Support schema-qualified table names in db clean#70147
Open
seanmuth wants to merge 2 commits into
Open
Conversation
Celery result backends are commonly provisioned into their own database
schema, separate from Airflow's metadata tables. airflow db clean has
no way to reach celery_taskmeta / celery_tasksetmeta in that case, since
it only ever looks in the connection's default schema, so those tables
are silently skipped every time.
_TableConfig, reflect_tables, and the archive/export/drop machinery in
db_cleanup.py now understand schema-qualified table names ("schema.table"
dot notation). A new [celery] result_backend_schema config option lets
a deployment point the built-in celery_taskmeta / celery_tasksetmeta
configs at the schema they actually live in, without needing a fork or
manual per-table config.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Celery result backends are commonly provisioned into their own database schema, separate from Airflow's metadata tables.
airflow db cleanhas no way to reachcelery_taskmeta/celery_tasksetmetain that case, since it only ever looks in the connection's default schema, so those tables are silently skipped every time._TableConfig,reflect_tables, and the archive/export/drop machinery indb_cleanup.pynow understand schema-qualified table names ("schema.table"dot notation). A new[celery] result_backend_schemaconfig option lets a deployment point the built-incelery_taskmeta/celery_tasksetmetaconfigs at the schema they actually live in, without needing a fork or manual per-table config.Verified end-to-end against a real Postgres instance: clean → archive (lands in the same schema as the source table) → export → drop, all schema-aware. New unit + integration tests cover schema parsing, the config-driven wiring, and the full cleanup cycle; existing test suite passes unmodified on both sqlite and Postgres.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Sonnet 5) following the guidelines