ferruzzi opened a new pull request, #73568: URL: https://github.com/apache/airflow/pull/73568
The guarded DELETE added in #66350 logged a warning only when ``deleted == 0``, which fires when an entire batch is skipped by the skip_if_referenced guard. The partial case is both the likely one and the harmful one: the archive has already committed a copy of every row the SELECT found, so a row the guard skips is archived and still live, and export-archived will emit a phantom copy of it. The count is gated on `skip_if_referenced` so tables that cannot skip rows don't pay the extra `COUNT(*)` per batch. That also drops a latent wrong message, since an unguarded table reaching `deleted == 0` previously claimed its rows were still referenced by another table when nothing referenced them. Raised by @ramitkataria while reviewing #66350. Blocks #73417 and should be merged first --- ##### 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 (please specify the tool below) Test case generated by: [Claude Sonnet 5] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
