-
Notifications
You must be signed in to change notification settings - Fork 15.1k
AIP-81: Update Transition of Jobs Command. #50837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c60a9e3
to
fc8a862
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes are needed
@@ -502,7 +502,7 @@ def list( | |||
) -> JobCollectionResponse | ServerResponseError: | |||
"""List all jobs.""" | |||
try: | |||
params = {"limit": limit, "job_type": job_type, "hostname": hostname, "is_alive": is_alive} | |||
params = {limit: limit, "job_type": job_type, "hostname": hostname, is_alive: is_alive} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params = {limit: limit, "job_type": job_type, "hostname": hostname, is_alive: is_alive} | |
params = {"limit": limit, "job_type": job_type, "hostname": hostname, "is_alive": is_alive} |
Key of limit
shouldn't be an integer here, same for is_alive
shouldn't be a bool.
We should include all the filters here
airflow/airflow-core/src/airflow/api_fastapi/core_api/routes/public/job.py
Lines 56 to 102 in b566a0b
start_date_range: Annotated[ | |
RangeFilter, | |
Depends(datetime_range_filter_factory("start_date", Job)), | |
], | |
end_date_range: Annotated[ | |
RangeFilter, | |
Depends(datetime_range_filter_factory("end_date", Job)), | |
], | |
limit: QueryLimit, | |
offset: QueryOffset, | |
order_by: Annotated[ | |
SortParam, | |
Depends( | |
SortParam( | |
[ | |
"id", | |
"dag_id", | |
"state", | |
"job_type", | |
"start_date", | |
"end_date", | |
"latest_heartbeat", | |
"executor_class", | |
"hostname", | |
"unixname", | |
], | |
Job, | |
).dynamic_depends(default="id") | |
), | |
], | |
session: SessionDep, | |
state: Annotated[ | |
FilterParam[str | None], Depends(filter_param_factory(Job.state, str | None, filter_name="job_state")) | |
], | |
job_type: Annotated[ | |
FilterParam[str | None], | |
Depends(filter_param_factory(Job.job_type, str | None, filter_name="job_type")), | |
], | |
hostname: Annotated[ | |
FilterParam[str | None], | |
Depends(filter_param_factory(Job.hostname, str | None, filter_name="hostname")), | |
], | |
executor_class: Annotated[ | |
FilterParam[str | None], | |
Depends(filter_param_factory(Job.executor_class, str | None, filter_name="executor_class")), | |
], | |
is_alive: bool | None = None, |
We shouldn't include the limit here since we should either filter or return the full result. See the above endpoint, it is very similar to all the list methods on the API side. It will be very similar to the return of all entities that you are working on. We shouldn't
closes: #45666
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in airflow-core/newsfragments.