Explorar o código

Fix schema typing (#396)

This PR changes the expected type of schema from BaseModel instance to BaseModel class because that is how it is used.

Co-authored-by: Michael Diskin <yhn112@users.noreply.github.com>
justheuristic %!s(int64=3) %!d(string=hai) anos
pai
achega
40d3ecebff
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      hivemind/dht/schema.py

+ 1 - 1
hivemind/dht/schema.py

@@ -18,7 +18,7 @@ class SchemaValidator(RecordValidatorBase):
     This allows to enforce types, min/max values, require a subkey to contain a public key, etc.
     This allows to enforce types, min/max values, require a subkey to contain a public key, etc.
     """
     """
 
 
-    def __init__(self, schema: pydantic.BaseModel, *, allow_extra_keys: bool = True, prefix: Optional[str] = None):
+    def __init__(self, schema: Type[pydantic.BaseModel], allow_extra_keys: bool = True, prefix: Optional[str] = None):
         """
         """
         :param schema: The Pydantic model (a subclass of pydantic.BaseModel).
         :param schema: The Pydantic model (a subclass of pydantic.BaseModel).