ginone commented on PR #45634:
URL: https://github.com/apache/airflow/pull/45634#issuecomment-2595762377

   @pikachuev thanks for the feedback!
   
   If you look at the code, `get_job_by_name` function specifically, you will 
notice there already is an optimization that works similarly to your 
suggestion. In order to minimize the response sizes, the process is done in 3 
steps:
   1. `list_projects` using `project_name` as filter 
(`name__icontains={project_name}`)
   2. `list_environments ` using `project_id` as a filter
   3. `list_jobs` using both `project_id` & `environment_id` as filters
   
   I decided to only use `name__icontains` for first step to limit the response 
size as retrieving all projects would not make sense. In 2nd & 3rd stages my 
assumption was that it should not be necessary to use such filtering because 
there should be no more than a few environments in each project and a dozen or 
so jobs in each environment.
   
   Now that you mentioned it, I think it would make sense to use 
`name__icontains` at least also for retrieving jobs, as there may be use cases 
when there are 100+ jobs in a single environment, so I'll submit that change 
shortly.


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to