uranusjr commented on code in PR #68517:
URL: https://github.com/apache/airflow/pull/68517#discussion_r4204119172


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/partitioned_dag_runs.py:
##########
@@ -390,11 +391,11 @@ def get_pending_partitioned_dag_run(
             AssetPartitionDagRun.partition_key == partition_key,
             AssetPartitionDagRun.created_dag_run_id.is_(None),
         )
-        # Duplicate pending rows for the same (dag_id, partition_key) can exist
-        # after a crash; mirror _get_or_create_apdr and work on the latest one.
-        .order_by(AssetPartitionDagRun.id.desc())
-        .limit(1)
-    ).first()
+        .order_by(AssetPartitionDagRun.created_at, AssetPartitionDagRun.id)

Review Comment:
   This should be `id.desc()`?



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