-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Add run_id filter for dag runs #52437
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?
Add run_id filter for dag runs #52437
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
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.
If something in UI changes it is cool to always also add a screenshot - that makes review easier. Can you add some mugshot to PR description?
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.
I am not fully sure about this feature, it is really a gap from previous version but the implementation only offers an exact match. No globbing.
I'd request some other reviewers as well, I assume next level is also we need to invest into better search capabilities in general, only exact run ID match is not much of a great value.
Please do not treat it tooo negative. I think in general the search capabilties are a shortcoming in the UI in general. I am unsure about the increments needed to get back to 2.11 state of options.
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.
Nice! Thanks for the PR, just a small nit. LGTM on API side after fix.
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py
Outdated
Show resolved
Hide resolved
That was fast! Awesome work. There are a number of other fields that could be sorted on, and I agree with
However, I do also think something is better than nothing? |
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.
Thanks for the pull request, that's a good idea.
We do support searching on patterns:
DESCRIPTION = (
"SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). "
"Regular expressions are **not** supported."
)
You can take a look at search_param_factory
to construct such filters on the API side.
For instance for the task_display_name_pattern
search.
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.
Nice, just a few nitpicks and should be good to merge.
Thanks for the pull request.
@@ -334,6 +336,7 @@ def get_dag_runs( | |||
readable_dag_runs_filter: ReadableDagRunsFilterDep, | |||
session: SessionDep, | |||
dag_bag: DagBagDep, | |||
run_id: Annotated[_SearchParam, Depends(search_param_factory(DagRun.run_id, "run_id"))], |
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.
run_id_pattern
to match other search query param in the API.
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.
faster than me! will update it
@@ -26,6 +26,7 @@ export enum SearchParamsKeys { | |||
OFFSET = "offset", | |||
PAUSED = "paused", | |||
POOL = "pool", | |||
RUN_ID = "run_id", |
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.
RUN_ID_PATTERN="run_id_pattern"
<Input | ||
maxW="200px" | ||
onChange={handleRunIdChange} | ||
placeholder={translate("dags:filters.runIdFilter")} |
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.
placeholder={translate("dags:filters.runIdFilter")} | |
placeholder={translate("dags:filters.runIdPatternFilter")} |
Really important remarks, Just applied to support pattern search. Thanks! I have some questions:
|
<InputGroup startElement={<FiHash size={14} />}> | ||
<Input | ||
maxW="200px" | ||
onChange={handleRunIdChange} | ||
placeholder={translate("dags:filters.runIdFilter")} | ||
value={filteredRunId ?? ""} | ||
/> | ||
</InputGroup> |
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.
Why don't we use the already existing SearchBar.tsx component? Especially if we update to to filter by run_id_pattern
?
Feature
run_id
filter to/dag_runs
pageDiscussion points
run_id
filter sufficient? or should we support more complex search parser?Feedback and suggestions are welcome!
^ 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.