insomnes commented on issue #46572:
URL: https://github.com/apache/airflow/issues/46572#issuecomment-2645999623

   From your initial PR conversation, I understood you are referencing the part 
where you extract `total_entries` from the response, and it shows all 
`total_entries` despite the limit set to 14.
   
   If so I believe that this number is not affected by pagination limits and 
offsets, the `total_entries` would be based on count from `filters=` fields. 
   
   ```python
       dag_run_select, total_entries = paginated_select(
           statement=query,
           filters=[logical_date, start_date_range, end_date_range, 
update_at_range, state],
           order_by=order_by,
           offset=offset,
           limit=limit,
           session=session,
       )
   ```
   
   And with curl behavior is also the same:
   <details>
   
     <summary>curl run for 2 entries</summary>
     
     
     ```bash
   curl -X 'GET' \
           
'http://localhost:29091/public/dags/example_bash_decorator/dagRuns?limit=2&order_by=-start_date'
 \
           -H 'accept: application/json' | jq
   {
     "dag_runs": [
       {
         "dag_run_id": "manual__2025-02-08T23:20:51.665298+00:00",
         "dag_id": "example_bash_decorator",
         "logical_date": "2025-02-08T23:20:51.673703Z",
         "queued_at": "2025-02-08T23:20:51.688648Z",
         "start_date": "2025-02-08T23:38:06.692506Z",
         "end_date": "2025-02-08T23:38:09.660110Z",
         "data_interval_start": "2025-02-08T23:20:51.673703Z",
         "data_interval_end": "2025-02-08T23:20:51.673703Z",
         "last_scheduling_decision": "2025-02-08T23:38:09.656040Z",
         "run_type": "manual",
         "state": "failed",
         "external_trigger": true,
         "triggered_by": "rest_api",
         "conf": {},
         "note": null
       },
       {
         "dag_run_id": "manual__2025-02-08T23:04:32.759689+00:00",
         "dag_id": "example_bash_decorator",
         "logical_date": "2025-02-08T23:04:32.759689Z",
         "queued_at": "2025-02-08T23:04:32.784971Z",
         "start_date": "2025-02-08T23:04:33.602888Z",
         "end_date": "2025-02-08T23:04:36.819802Z",
         "data_interval_start": "2025-02-08T23:04:32.759689Z",
         "data_interval_end": "2025-02-08T23:04:32.759689Z",
         "last_scheduling_decision": "2025-02-08T23:04:36.817639Z",
         "run_type": "manual",
         "state": "failed",
         "external_trigger": true,
         "triggered_by": "ui",
         "conf": {},
         "note": null
       }
     ],
     "total_entries": 127
   }
     ```
     
   </details>
   
   Or the problem is that API returns the wrong number of entries in `dag_runs` 
field?


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