diff --git a/src/scitacean/client.py b/src/scitacean/client.py index 4519e074..01484ea0 100644 --- a/src/scitacean/client.py +++ b/src/scitacean/client.py @@ -711,8 +711,8 @@ def query_datasets( self, fields: dict[str, Any], *, - limit: Optional[int] = None, - order: Optional[str] = None, + limit: int | None = None, + order: str | None = None, strict_validation: bool = False, ) -> list[model.DownloadDataset]: """Query for datasets in SciCat. @@ -783,7 +783,7 @@ def query_datasets( ) params = {"fields": params_model(**fields).model_dump_json()} - limits: dict[str, Union[str, int]] = {} + limits: dict[str, str | int] = {} if order is not None: limits["order"] = order if limit is not None: @@ -1154,7 +1154,7 @@ def _call_endpoint( url: str, operation: str, data: model.BaseModel | None = None, - params: Optional[dict[str, str]] = None, + params: dict[str, str] | None = None, ) -> Any: full_url = _url_concat(self._base_url, url) logger = get_logger() diff --git a/tests/client/query_client_test.py b/tests/client/query_client_test.py index 49a97950..81d8a7ba 100644 --- a/tests/client/query_client_test.py +++ b/tests/client/query_client_test.py @@ -1,7 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2024 SciCat Project (https://github.com/SciCatProject/scitacean) -from typing import Union import pytest from dateutil.parser import parse as parse_datetime @@ -10,9 +9,7 @@ from scitacean.testing.backend import skip_if_not_backend from scitacean.testing.backend.config import SciCatAccess -UPLOAD_DATASETS: dict[ - str, Union[model.UploadDerivedDataset, model.UploadRawDataset] -] = { +UPLOAD_DATASETS: dict[str, model.UploadDerivedDataset | model.UploadRawDataset] = { "raw1": model.UploadRawDataset( ownerGroup="PLACEHOLDER", accessGroups=["uu", "faculty"],