mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-11-25 06:46:25 +00:00
fix: pydantic extra keywords deprecated (#753)
Pydantic deprecates using extra keyword arguments on Field. Used json_schema_extra instead. Deprecated in Pydantic V2.0 to be removed in V3.0. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -21,7 +21,7 @@ class ElecPriceDataRecord(PredictionRecord):
|
||||
"""
|
||||
|
||||
elecprice_marketprice_wh: Optional[float] = Field(
|
||||
None, description="Electricity market price per Wh (€/Wh)"
|
||||
None, json_schema_extra={"description": "Electricity market price per Wh (€/Wh)"}
|
||||
)
|
||||
|
||||
# Computed fields
|
||||
@@ -59,7 +59,8 @@ class ElecPriceProvider(PredictionProvider):
|
||||
|
||||
# overload
|
||||
records: List[ElecPriceDataRecord] = Field(
|
||||
default_factory=list, description="List of ElecPriceDataRecord records"
|
||||
default_factory=list,
|
||||
json_schema_extra={"description": "List of ElecPriceDataRecord records"},
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user