refactor: fix variable typo
This commit is contained in:
@@ -15,4 +15,4 @@ class AnnotationType(TypedDict, total=False):
|
|||||||
label: str
|
label: str
|
||||||
|
|
||||||
|
|
||||||
AnnotationTypePA = TypeAdapter(AnnotationType)
|
AnnotationTypeTA = TypeAdapter(AnnotationType)
|
||||||
|
|||||||
@@ -1813,14 +1813,14 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||||||
end_date=dataframe.iloc[-1]["date"].to_pydatetime(),
|
end_date=dataframe.iloc[-1]["date"].to_pydatetime(),
|
||||||
)
|
)
|
||||||
|
|
||||||
from freqtrade.ft_types.plot_annotation_type import AnnotationTypePA
|
from freqtrade.ft_types.plot_annotation_type import AnnotationTypeTA
|
||||||
|
|
||||||
annotations_new: list[AnnotationType] = []
|
annotations_new: list[AnnotationType] = []
|
||||||
for annotation in annotations:
|
for annotation in annotations:
|
||||||
if isinstance(annotation, dict):
|
if isinstance(annotation, dict):
|
||||||
# Convert to AnnotationType
|
# Convert to AnnotationType
|
||||||
try:
|
try:
|
||||||
AnnotationTypePA.validate_python(annotation)
|
AnnotationTypeTA.validate_python(annotation)
|
||||||
annotations_new.append(annotation)
|
annotations_new.append(annotation)
|
||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
logger.error(f"Invalid annotation data: {annotation}. Error: {e}")
|
logger.error(f"Invalid annotation data: {annotation}. Error: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user