bugraoz93 commented on code in PR #47867:
URL: https://github.com/apache/airflow/pull/47867#discussion_r1999517618
##########
airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -327,7 +328,9 @@ def get_dag_runs(
This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for
all DAGs.
"""
query = select(DagRun)
-
+ if dag_run_id_pattern:
+ query = query.filter(DagRun.run_id.like(dag_run_id_pattern))
+
Review Comment:
I agree, we are following that pattern. You can leverage
`airflow.api_fastapi.common.parameters` where there are factories. You can
build any filter you want easily even if it doesn't exist.
I am also concerned that we shouldn't accept any SQL query (`LIKE`) like
this with accepting wildcards or so.
See
https://labs.portcullis.co.uk/whitepapers/dos-attacks-using-sql-wildcards/.
So no for patterns. If only string is supplied without patterns, that's
okay.
I believe we already provide some patterns like search. So if this fits into
that, that's also okay.
--
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]