Skip to content

Commit

Permalink
make typechecking test happy
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis committed Dec 4, 2024
1 parent a87c031 commit 78b1ebf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class BasicSettings(BaseCustomSettings, MixinLoggingSettings):

# LOGGING
LOG_LEVEL: LogLevel = Field(
default=LogLevel.INFO.value,
default=LogLevel.INFO,
validation_alias=AliasChoices("API_SERVER_LOGLEVEL", "LOG_LEVEL", "LOGLEVEL"),
)
API_SERVER_LOG_FORMAT_LOCAL_DEV_ENABLED: bool = Field(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re
import urllib.parse
from typing import Annotated, Any, TypeAlias
from typing import Annotated, TypeAlias

from pydantic import BaseModel, Field, TypeAdapter
from pydantic import Field, TypeAdapter
from pydantic.types import StringConstraints

# RESOURCE NAMES https://cloud.google.com/apis/design/resource_names
Expand Down Expand Up @@ -56,20 +56,3 @@ def compose_resource_name(*collection_or_resource_ids) -> RelativeResourceName:
def split_resource_name(resource_name: RelativeResourceName) -> list[str]:
quoted_parts = resource_name.split("/")
return [f"{urllib.parse.unquote_plus(p)}" for p in quoted_parts]


#
# For resource definitions, the first field should be a string field for the resource name,
# and it should be called *name*
# Resource IDs must be clearly documented whether they are assigned by the client, the server, or either
#
class BaseResource(BaseModel):
name: RelativeResourceName = Field(None, examples=["solvers/isolve/releases/1.2.3"])
id: Any = Field(None, description="Resource ID", examples=["1.2.3"]) # noqa: A003


class BaseCollection(BaseModel):
name: RelativeResourceName = Field(None, examples=["solvers/isolve/releases"])
id: Any = Field(
None, description="Collection ID", examples=["releases"]
) # noqa: A003

0 comments on commit 78b1ebf

Please sign in to comment.