Repository navigation
Support schema-qualified table names in db clean - #70147
Merged
uranusjr merged 3 commits intoJul 28, 2026
Merged
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.
eladkal
reviewed
Jul 24, 2026
Member
|
I added a commit that removed the reading-provider-in-core part. This PR now only contains adding support for schema-qualified table names in db clean. Once this is accepted, I will raise a second PR that implements the Celery table name cleanup with a cleaner approach. |
uranusjr
approved these changes
Jul 28, 2026
We're going to do the provider support separately instead in a cleaner way (providers should implement a hook point called in core). This leaves the current branch with only adding support for dotted (qualified) table name with a schema prefix, which is useful anyway. We will actually use this feature in a different subsequent PR.
uranusjr
force-pushed
the
db-cleanup-schema-qualified-tables
branch
from
July 28, 2026 11:23
b6727c7 to
8a0a406
Compare
Contributor
LGTM then |
eladkal
approved these changes
Jul 28, 2026
dabla
pushed a commit
to dabla/airflow
that referenced
this pull request
Aug 14, 2026
Co-authored-by: TP <uranusjr@apache.org>
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