Content-Length: 339666 | pFad | http://github.com/apache/airflow/pull/50837

2F AIP-81: Update Transition of Jobs Command. by Prab-27 · Pull Request #50837 · apache/airflow · GitHub
Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Prab-27
Copy link
Contributor

@Prab-27 Prab-27 commented May 20, 2025

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.

Copy link
Contributor

@bugraoz93 bugraoz93 left a 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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AIP-81 Transition of Jobs Command
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/apache/airflow/pull/50837

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy