jinoo7099 opened a new pull request, #67187:
URL: https://github.com/apache/airflow/pull/67187

   ## 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.
   
   - closes: #42003
   
   ## 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?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, 
please
   change below checkbox to `[X]` followed by the name of the tool, uncomment 
the "Generated-by".
   -->
   
   - [x] Yes codex(gpt 5.5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to