vincbeck commented on code in PR #73684:
URL: https://github.com/apache/airflow/pull/73684#discussion_r4105773656
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/job.py:
##########
@@ -106,6 +106,11 @@ def get_jobs(
"""Get all jobs."""
base_select =
select(Job).order_by(Job.latest_heartbeat.desc()).options(joinedload(Job.dag_model))
+ if is_alive is not None:
+ # Filter in SQL rather than on the fetched page so total_entries and
the page agree.
+ alive = Job.alive_filter()
+ base_select = base_select.where(alive if is_alive else ~alive)
+
Review Comment:
You're 100% right boss! Thanks for the review :) I updated the PR with your
recommendations
--
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]