pierrejeambrun commented on code in PR #73119:
URL: https://github.com/apache/airflow/pull/73119#discussion_r4347660712


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -715,17 +801,27 @@ def delete_asset_queued_events(
     readable_dags_filter: ReadableDagsFilterDep,
     session: SessionDep,
     before: OptionalDateTimeQuery = None,
+    partition_key: QueuedEventPartitionKeyQuery = None,
 ):
     """Delete queued asset events for an asset."""
-    where_clause = _generate_queued_event_where_clause(
-        asset_id=asset_id, before=before, 
permitted_dag_ids=readable_dags_filter.value
-    )
-    delete_stmt = delete(AssetDagRunQueue).where(*where_clause)
-    result = cast("CursorResult", session.execute(delete_stmt))
-    if result.rowcount == 0:
+    if partition_key is not None:
+        deleted = _delete_pending_partitioned_queued_events(
+            partition_key=partition_key,
+            asset_id=asset_id,
+            before=before,
+            permitted_dag_ids=readable_dags_filter.value,

Review Comment:
   Since #74839, this route only deletes the queued events of Dags the user can 
edit (`editable_dags_filter`), and it conflicts with this branch now. Could you 
rebase and pass `editable_dags_filter.value` here too? 
`test_only_deletes_events_queued_for_readable_dags` returns the same Dag ids 
for every method, so it wouldn't catch the difference. Could it use 
`_authorized_dag_ids_by_method(readable=..., editable=...)` like 
`TestDeleteAssetQueuedEvents` does on main?



-- 
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