Skip to content

Commit 6c2a5b4

Browse files
committed
feat: use extra="forbid" in annotation Validations
this can be problematic if many users have additional data in their annotations.
1 parent aa302fe commit 6c2a5b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

freqtrade/strategy/interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,9 @@ def ft_plot_annotations(self, pair: str, dataframe: DataFrame) -> list[Annotatio
18711871
if isinstance(annotation, dict):
18721872
# Convert to AnnotationType
18731873
try:
1874-
AnnotationTypeTA.validate_python(annotation)
1874+
# "forbid" extra fields to catch user errors
1875+
# Can be questioned if this creates many problems
1876+
AnnotationTypeTA.validate_python(annotation, extra="forbid")
18751877
annotations_new.append(annotation)
18761878
except ValidationError as e:
18771879
logger.error(f"Invalid annotation data: {annotation}. Error: {e}")

0 commit comments

Comments
 (0)