chore: Add proper typing to jobContainer response
This commit is contained in:
@@ -12,6 +12,7 @@ from pydantic import (
|
|||||||
from freqtrade.constants import DL_DATA_TIMEFRAMES, IntOrInf
|
from freqtrade.constants import DL_DATA_TIMEFRAMES, IntOrInf
|
||||||
from freqtrade.enums import MarginMode, OrderTypeValues, SignalDirection, TradingMode
|
from freqtrade.enums import MarginMode, OrderTypeValues, SignalDirection, TradingMode
|
||||||
from freqtrade.ft_types import ValidExchangesType
|
from freqtrade.ft_types import ValidExchangesType
|
||||||
|
from freqtrade.rpc.api_server.webserver_bgwork import ProgressTask
|
||||||
|
|
||||||
|
|
||||||
class ExchangeModePayloadMixin(BaseModel):
|
class ExchangeModePayloadMixin(BaseModel):
|
||||||
@@ -50,7 +51,7 @@ class BackgroundTaskStatus(BaseModel):
|
|||||||
status: str
|
status: str
|
||||||
running: bool
|
running: bool
|
||||||
progress: float | None = None
|
progress: float | None = None
|
||||||
progress_tasks: dict[str, Any] | None = None
|
progress_tasks: dict[str, ProgressTask] | None = None
|
||||||
error: str | None = None
|
error: str | None = None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,18 @@ from uuid import uuid4
|
|||||||
from freqtrade.exchange.exchange import Exchange
|
from freqtrade.exchange.exchange import Exchange
|
||||||
|
|
||||||
|
|
||||||
|
class ProgressTask(TypedDict):
|
||||||
|
progress: float
|
||||||
|
total: float
|
||||||
|
description: str
|
||||||
|
|
||||||
|
|
||||||
class JobsContainer(TypedDict):
|
class JobsContainer(TypedDict):
|
||||||
category: Literal["pairlist", "download_data"]
|
category: Literal["pairlist", "download_data"]
|
||||||
is_running: bool
|
is_running: bool
|
||||||
status: str
|
status: str
|
||||||
progress: float | None
|
progress: float | None
|
||||||
progress_tasks: NotRequired[dict[str, Any]]
|
progress_tasks: NotRequired[dict[str, ProgressTask]]
|
||||||
result: Any
|
result: Any
|
||||||
error: str | None
|
error: str | None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user