Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ademariag committed Mar 29, 2024
1 parent 7b4307c commit 2310189
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions kadet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import hashlib
import json
from typing import Annotated

import yaml
from box import Box, BoxList
from pydantic import BaseModel as PydanticBaseModel, Field
from pydantic import BaseModel as PydanticBaseModel
from pydantic import Field
from typeguard import check_type

ABORT_EXCEPTION_TYPE = ValueError
Expand Down Expand Up @@ -194,6 +196,11 @@ def sha256(self):

class BaseModel(PydanticBaseModel):
root: Annotated[Dict, Field(repr=False)] = Dict()
model_config: Dict = {
# https://docs.pydantic.dev/latest/migration/#changes-to-config
"arbitrary_types_allowed": True,
"extra": "allow",
}

def __init__(self, **data):
super().__init__(**data)
Expand Down Expand Up @@ -250,9 +257,3 @@ def _dump(self, obj):
def dump(self):
"""Return object dict/list."""
return self._dump(self)

class Config:
arbitrary_types_allowed = True # allow all types e.g. BaseObj
copy_on_model_validation = False # performance?
underscore_attrs_are_private = True
extra = "allow"

0 comments on commit 2310189

Please sign in to comment.