diff --git a/src/scitacean/client.py b/src/scitacean/client.py index d4fd0f08..4519e074 100644 --- a/src/scitacean/client.py +++ b/src/scitacean/client.py @@ -778,12 +778,12 @@ def query_datasets( ) """ # Use a pydantic model to support serializing custom types to JSON. - params_model = pydantic.create_model( + params_model = pydantic.create_model( # type: ignore[call-overload] "QueryParams", **{key: (type(field), ...) for key, field in fields.items()} ) params = {"fields": params_model(**fields).model_dump_json()} - limits = {} + limits: dict[str, Union[str, int]] = {} if order is not None: limits["order"] = order if limit is not None: diff --git a/tests/client/query_client_test.py b/tests/client/query_client_test.py index e9730064..49a97950 100644 --- a/tests/client/query_client_test.py +++ b/tests/client/query_client_test.py @@ -1,6 +1,8 @@ # 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 @@ -8,7 +10,9 @@ from scitacean.testing.backend import skip_if_not_backend from scitacean.testing.backend.config import SciCatAccess -UPLOAD_DATASETS = { +UPLOAD_DATASETS: dict[ + str, Union[model.UploadDerivedDataset, model.UploadRawDataset] +] = { "raw1": model.UploadRawDataset( ownerGroup="PLACEHOLDER", accessGroups=["uu", "faculty"],