diff --git a/lib/galaxy/webapps/galaxy/api/datasets.py b/lib/galaxy/webapps/galaxy/api/datasets.py index a725150c378..74dc747c8b6 100644 --- a/lib/galaxy/webapps/galaxy/api/datasets.py +++ b/lib/galaxy/webapps/galaxy/api/datasets.py @@ -374,9 +374,9 @@ class FastAPIDatasets: self, request: Request, history_content_id: HistoryDatasetIDPathParam, - history_id: Optional[HistoryIDPathParam] = None, + history_id: HistoryIDPathParam | None = None, trans=DependsOnTrans, - to_ext: Optional[str] = ToExtQueryParam, + to_ext: str | None = ToExtQueryParam, ): """Downloads the whole dataset file. Clients must follow the 302 redirect this route may return.""" return self._download(request, trans, history_content_id, to_ext) @@ -396,12 +396,12 @@ class FastAPIDatasets: request: Request, history_content_id: HistoryDatasetIDPathParam, trans=DependsOnTrans, - to_ext: Optional[str] = ToExtQueryParam, + to_ext: str | None = ToExtQueryParam, ): """Downloads the whole dataset file. Clients must follow the 302 redirect this route may return.""" return self._download(request, trans, history_content_id, to_ext) - def _download(self, request: Request, trans, dataset_id: DecodedDatabaseIdField, to_ext: Optional[str]): + def _download(self, request: Request, trans, dataset_id: DecodedDatabaseIdField, to_ext: str | None): # Default to_ext to "data" so the route always behaves as a whole-file download (server infers # the extension from the datatype) rather than a preview. to_ext = to_ext or "data" diff --git a/lib/galaxy/webapps/galaxy/services/datasets.py b/lib/galaxy/webapps/galaxy/services/datasets.py index ea2011e4631..d4b1da43ad0 100644 --- a/lib/galaxy/webapps/galaxy/services/datasets.py +++ b/lib/galaxy/webapps/galaxy/services/datasets.py @@ -650,9 +650,9 @@ class DatasetsService(ServiceBase, UsesVisualizationMixin): self, trans: ProvidesHistoryContext, dataset_id: DecodedDatabaseIdField, - to_ext: Optional[str] = None, + to_ext: str | None = None, hda_ldda: DatasetSourceType = DatasetSourceType.hda, - ) -> Optional[str]: + ) -> str | None: """Return a backing-store URL a whole-file download can be redirected to, or None to stream. Used by the dedicated download route; the regular display route never redirects. @@ -678,7 +678,7 @@ class DatasetsService(ServiceBase, UsesVisualizationMixin): self, trans: ProvidesHistoryContext, dataset_id: DecodedDatabaseIdField, - to_ext: Optional[str] = None, + to_ext: str | None = None, hda_ldda: DatasetSourceType = DatasetSourceType.hda, ) -> dict[str, str]: """Build response headers for a HEAD download request from object-store metadata.