Convert to pydantic - jsonencoders (no longer exists)

This commit is contained in:
Matthias 2023-07-18 18:23:58 +02:00
parent 47850ce1b0
commit d78eb834c4

View File

@ -482,11 +482,11 @@ class PairHistory(BaseModel):
data_start: str
data_stop: str
data_stop_ts: int
class Config:
json_encoders = {
# TODO[pydantic]: The following keys were removed: `json_encoders`.
# Check https://docs.pydantic.dev/dev-v2/migration/#changes-to-config for more information.
model_config = ConfigDict(json_encoders={
datetime: lambda v: v.strftime(DATETIME_PRINT_FORMAT),
}
})
class BacktestFreqAIInputs(BaseModel):
@ -515,7 +515,7 @@ class BacktestResponse(BaseModel):
progress: float
trade_count: Optional[float] = None
# TODO: Properly type backtestresult...
backtest_result: SerializeAsAny[Optional[Dict[str, Any]]] = None
backtest_result: SerializeAsAny[Optional[Dict[str, Any]]]
# TODO: This is a copy of BacktestHistoryEntryType