Skip to content

Commit

Permalink
Fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed May 27, 2024
1 parent 5236160 commit ce6cff8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/scitacean/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,12 +781,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:
Expand Down
6 changes: 5 additions & 1 deletion tests/client/query_client_test.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# 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

from scitacean import Client, DatasetType, RemotePath, model
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"],
Expand Down

0 comments on commit ce6cff8

Please sign in to comment.