fix: drop dead code phase2 unused class (#22042)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
@@ -148,25 +148,6 @@ class StrLen:
|
||||
return value
|
||||
|
||||
|
||||
class FloatRange:
|
||||
"""Restrict input to an float in a range (inclusive)"""
|
||||
|
||||
def __init__(self, low, high, argument="argument"):
|
||||
self.low = low
|
||||
self.high = high
|
||||
self.argument = argument
|
||||
|
||||
def __call__(self, value):
|
||||
value = _get_float(value)
|
||||
if value < self.low or value > self.high:
|
||||
error = "Invalid {arg}: {val}. {arg} must be within the range {lo} - {hi}".format(
|
||||
arg=self.argument, val=value, lo=self.low, hi=self.high
|
||||
)
|
||||
raise ValueError(error)
|
||||
|
||||
return value
|
||||
|
||||
|
||||
class DatetimeString:
|
||||
def __init__(self, format, argument="argument"):
|
||||
self.format = format
|
||||
|
@@ -1,11 +0,0 @@
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class PydanticModelEncoder(json.JSONEncoder):
|
||||
def default(self, o):
|
||||
if isinstance(o, BaseModel):
|
||||
return o.model_dump()
|
||||
else:
|
||||
super().default(o)
|
Reference in New Issue
Block a user