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


##########
airflow/cli/commands/jobs_command.py:
##########
@@ -32,21 +32,17 @@ def check(args, session: Session = NEW_SESSION) -> None:
     if args.hostname and args.local:
         raise SystemExit("You can't use --hostname and --local at the same 
time")
 
-    query = (
-        session.query(BaseJob)
-        .filter(BaseJob.state == State.RUNNING)
-        .order_by(BaseJob.latest_heartbeat.desc())
-    )
+    query = session.query(Job).filter(Job.state == 
State.RUNNING).order_by(Job.latest_heartbeat.desc())
     if args.job_type:
-        query = query.filter(BaseJob.job_type == args.job_type)
+        query = query.filter(Job.job_type == args.job_type)
     if args.hostname:
-        query = query.filter(BaseJob.hostname == args.hostname)
+        query = query.filter(Job.hostname == args.hostname)
     if args.local:
-        query = query.filter(BaseJob.hostname == get_hostname())
+        query = query.filter(Job.hostname == get_hostname())
     if args.limit > 0:
         query = query.limit(args.limit)
 
-    jobs: list[BaseJob] = query.all()
+    jobs: list[Job] = query.all()
     alive_jobs = [job for job in jobs if job.is_alive()]

Review Comment:
   ```python
   alive_jobs: list[Job] = [job for job in query if job.is_alive()]
   ```
   
   Not really related but a good chance to get rid of the intermediate list.



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