amoghrajesh commented on code in PR #52876: URL: https://github.com/apache/airflow/pull/52876#discussion_r2197808536
########## airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_versions.py: ########## @@ -41,10 +42,21 @@ class DagVersionResponse(BaseModel): @property def bundle_url(self) -> str | None: if self.bundle_name: - try: - return DagBundlesManager().view_url(self.bundle_name, self.bundle_version) - except ValueError: - return None + # Get the bundle model from the database and render the URL + from airflow.models.dagbundle import DagBundleModel + from airflow.utils.session import create_session + + with create_session() as session: + bundle_model = session.scalar( + select(DagBundleModel).where(DagBundleModel.name == self.bundle_name) + ) + + if bundle_model and hasattr(bundle_model, "signed_url_template"): + return bundle_model.render_url(self.bundle_version) + try: + return DagBundlesManager().view_url(self.bundle_name, self.bundle_version) + except ValueError: + return None Review Comment: Makes sense, thanks! -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org