jason810496 commented on code in PR #46279:
URL: https://github.com/apache/airflow/pull/46279#discussion_r1935912324
##########
airflow/api_fastapi/core_api/routes/ui/structure.py:
##########
@@ -43,9 +45,23 @@ def structure_data(
include_downstream: QueryIncludeDownstream = False,
root: str | None = None,
external_dependencies: bool = False,
+ dag_version: int | None = None,
) -> StructureDataResponse:
"""Get Structure Data."""
- dag = request.app.state.dag_bag.get_dag(dag_id)
+ if dag_version is None:
+ dag = request.app.state.dag_bag.get_dag(dag_id)
+ else:
+ serialized_dag: SerializedDagModel = session.scalar(
+ select(SerializedDagModel)
+ .join(DagVersion)
+ .where(SerializedDagModel.dag_id == dag_id,
DagVersion.version_number == dag_version)
Review Comment:
After some attempts, it can also retrieve the same result using only
`SerializedDagModel`.
--
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]