You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "rawwar (via GitHub)" <gi...@apache.org> on 2025/08/24 10:22:00 UTC
[PR] add dag_version filter to get_dag_runs endpoint and corresponding tests [airflow]
rawwar opened a new pull request, #54882:
URL: https://github.com/apache/airflow/pull/54882
related to https://github.com/apache/airflow/issues/53043
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add dag_version filter to get_dag_runs endpoint and corresponding tests [airflow]
Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 commented on code in PR #54882:
URL: https://github.com/apache/airflow/pull/54882#discussion_r2316041693
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -360,6 +363,10 @@ def get_dag_runs(
get_latest_version_of_dag(dag_bag, dag_id, session) # Check if the DAG exists.
query = query.filter(DagRun.dag_id == dag_id).options(joinedload(DagRun.dag_model))
+ # Add join with DagVersion if dag_version filter is active
+ if dag_version.value:
+ query = query.join(DagVersion, DagRun.created_dag_version_id == DagVersion.id)
Review Comment:
I see. Both works for me, we can merge this as my comment is more like nit.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add dag_version filter to get_dag_runs endpoint and corresponding tests [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #54882:
URL: https://github.com/apache/airflow/pull/54882
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add dag_version filter to get_dag_runs endpoint and corresponding tests [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #54882:
URL: https://github.com/apache/airflow/pull/54882#discussion_r2315744700
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -360,6 +363,10 @@ def get_dag_runs(
get_latest_version_of_dag(dag_bag, dag_id, session) # Check if the DAG exists.
query = query.filter(DagRun.dag_id == dag_id).options(joinedload(DagRun.dag_model))
+ # Add join with DagVersion if dag_version filter is active
+ if dag_version.value:
+ query = query.join(DagVersion, DagRun.created_dag_version_id == DagVersion.id)
Review Comment:
Yes, we've been doing this for a few filters already. I think this is cleaner and we can do that here too.
But we also have this construct at other places of the code, so I don't mind merging it like this for now.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add dag_version filter to get_dag_runs endpoint and corresponding tests [airflow]
Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 commented on code in PR #54882:
URL: https://github.com/apache/airflow/pull/54882#discussion_r2297708933
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -360,6 +363,10 @@ def get_dag_runs(
get_latest_version_of_dag(dag_bag, dag_id, session) # Check if the DAG exists.
query = query.filter(DagRun.dag_id == dag_id).options(joinedload(DagRun.dag_model))
+ # Add join with DagVersion if dag_version filter is active
+ if dag_version.value:
+ query = query.join(DagVersion, DagRun.created_dag_version_id == DagVersion.id)
Review Comment:
In this case, how about adding new filter class and add the `join` statement in the `to_orm` method? Then we can remove the explicit `if` block.
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org