Repository navigation
Add an API to delete asset event history - #74495
Draft
hussein-awala wants to merge 2 commits into
Draft
hussein-awala wants to merge 2 commits into
hussein-awala wants to merge 2 commits into
Conversation
This was referenced Oct 15, 2026
Administrators need to prune stale events for an individual asset without invoking whole-table metadata cleanup or unintentionally removing pending scheduling work.
Partitioned consumers need the same retention safeguards as regular queues. Concurrent scheduling and event production must not lose pending references or fail when retention runs at the same time. Generated-by: Codex (GPT-6)
hussein-awala
force-pushed
the
delete-asset-events-api
branch
from
October 27, 2026 23:42
ae4ca12 to
c27eab2
Compare
This branch has not been deployed
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.
Summary
Add
DELETE /api/v2/assets/{asset_id}/eventsto permanently remove one asset's historical events strictly before a requiredbeforetimestamp.This provides a per-asset retention operation through the public API. The existing queued-event endpoints remove scheduling queue entries, not event history, while
airflow db clean --tables asset_eventis table-level maintenance.Behavior
delete_queued_eventsto false. If matching events still have queue references, return 409 without deleting any events.delete_queued_events=true, allow the existing database cascades to remove dependent queue, Dag-run/event, and alias/event references. Asset, Dag, Dag-run, and alias parent records remain intact.dag_idquery cannot narrow authorization.The change is limited to the route, a backward-compatible authorization-helper option, focused tests, and generated OpenAPI/client/permission documentation. It adds no migration, dependency, automatic retention job, SDK helper, or CLI change.
Validation
breeze verify: core API/Always and common.compat/FAB database and non-database suites; both UI suites; generated Python API client tests (360 passed); and Airflow/common.compat/FAB documentation builds.NODE_OPTIONS=--no-experimental-webstoragewith the local Node 26 runtime. No project-code workaround was added.main, the patch was unchanged and the 370-test asset/security suite passed again.MySQL execution remains unverified. All eligible IDs and locks are retained for one transaction; the internal chunks limit bind parameters, not memory or lock duration. Deletion is permanent and does not create archive tables.
Was generative AI tooling used to co-author this PR?
Generated-by: Pi 0.84.3 following the guidelines
Drafted-by: Pi 0.84.3 (no human review before posting)