chore: improve type-safety
This commit is contained in:
@@ -5,7 +5,7 @@ from typing_extensions import NotRequired, TypedDict
|
|||||||
|
|
||||||
|
|
||||||
class AnnotationType(TypedDict):
|
class AnnotationType(TypedDict):
|
||||||
type: Literal["area"] = "area"
|
type: Literal["area"]
|
||||||
start: NotRequired[str | datetime]
|
start: NotRequired[str | datetime]
|
||||||
end: NotRequired[str | datetime]
|
end: NotRequired[str | datetime]
|
||||||
y_start: NotRequired[float]
|
y_start: NotRequired[float]
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ from freqtrade.enums import (
|
|||||||
from freqtrade.exceptions import ExchangeError, PricingError
|
from freqtrade.exceptions import ExchangeError, PricingError
|
||||||
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_msecs
|
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_msecs
|
||||||
from freqtrade.exchange.exchange_utils import price_to_precision
|
from freqtrade.exchange.exchange_utils import price_to_precision
|
||||||
|
from freqtrade.ft_types import AnnotationType
|
||||||
from freqtrade.loggers import bufferHandler
|
from freqtrade.loggers import bufferHandler
|
||||||
from freqtrade.persistence import KeyStoreKeys, KeyValueStore, PairLocks, Trade
|
from freqtrade.persistence import KeyStoreKeys, KeyValueStore, PairLocks, Trade
|
||||||
from freqtrade.persistence.models import PairLock
|
from freqtrade.persistence.models import PairLock
|
||||||
@@ -1299,8 +1300,8 @@ class RPC:
|
|||||||
timeframe: str,
|
timeframe: str,
|
||||||
dataframe: DataFrame,
|
dataframe: DataFrame,
|
||||||
last_analyzed: datetime,
|
last_analyzed: datetime,
|
||||||
selected_cols: list[str],
|
selected_cols: list[str] | None,
|
||||||
annotations: list[dict[str, Any]] = None,
|
annotations: list[AnnotationType],
|
||||||
) -> dict[str, Any]:
|
) -> dict[str, Any]:
|
||||||
has_content = len(dataframe) != 0
|
has_content = len(dataframe) != 0
|
||||||
dataframe_columns = list(dataframe.columns)
|
dataframe_columns = list(dataframe.columns)
|
||||||
|
|||||||
Reference in New Issue
Block a user