Skip to content

fix: db clean skip-archive creating archive tables - #67187

Closed
jinoo7099 wants to merge 1 commit into
apache:mainfrom
jinoo7099:fix/db-clean-skip-archive
Closed

jinoo7099 wants to merge 1 commit into
apache:mainfrom
jinoo7099:fix/db-clean-skip-archive

Conversation

@jinoo7099

Copy link
Copy Markdown
Contributor

Description

airflow db clean --skip-archive is expected to delete matching rows directly from the source metadata table without creating archive tables.

Previously, the cleanup path still followed the archive-first flow even when --skip-archive was enabled: it created an _airflow_deleted__... archive table, copied rows into it, deleted matching rows from the source table, and then dropped the archive table.

This change splits the skip-archive path so it deletes matching rows directly from the source table while preserving the existing cleanup filters, batching behavior, and keep-last behavior.

Changes

  • Add a direct delete path for skip_archive=True.
  • Keep the existing archive-table flow unchanged for skip_archive=False.
  • Avoid creating, inserting into, or dropping _airflow_deleted__... tables when skip-archive is enabled.
  • Add regression coverage to verify skip-archive cleanup does not emit archive-table SQL.
  • Add coverage for both single-delete and batched cleanup paths.

Tests

  • uv run --frozen --project airflow-core pytest airflow-core/tests/unit/utils/test_db_cleanup.py -xvs --with-db-init
  • prek run --from-ref main --stage pre-commit

Was generative AI tooling used to co-author this PR?
  • Yes codex(gpt 5.5)

@jinoo7099
jinoo7099 force-pushed the fix/db-clean-skip-archive branch from 5f8b79c to f0397c9 Compare May 19, 2026 17:08
@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label May 24, 2026
@potiuk

potiuk commented Jun 25, 2026

Copy link
Copy Markdown
Member

@jinoo7099 — I've removed the ready for maintainer review label because the next step here is yours: this branch now has merge conflicts with main. It'll go back into the maintainer queue automatically once you rebase onto the latest main and push — no need to re-add the label by hand. There's no rush.

Automated triage note drafted by an AI-assisted tool — may get things wrong; a real Apache Airflow maintainer takes the next look once it's green. (why automated)


Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting

@potiuk potiuk removed the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Jun 25, 2026
@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Jul 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Aug 17, 2026
@github-actions github-actions Bot closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip_archive should actually skip archive in db clean command

2 participants