Skip to content

Commit 3fd1cfd

Browse files
bmaranvillegvwilson
authored andcommitted
use validators from ValidatorCache
1 parent 930509f commit 3fd1cfd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

plotly/basedatatypes.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,11 @@ class is a subclass of both BaseFigure and widgets.DOMWidget.
468468
if a property in the specification of data, layout, or frames
469469
is invalid AND skip_invalid is False
470470
"""
471-
from .validators import DataValidator, LayoutValidator, FramesValidator
471+
from .validator_cache import ValidatorCache
472+
DataValidator = ValidatorCache.get_validator("", "data")
473+
FramesValidator = ValidatorCache.get_validator("", "frames")
474+
LayoutValidator = ValidatorCache.get_validator("", "layout")
475+
# from .validators import DataValidator, LayoutValidator, FramesValidator
472476

473477
super(BaseFigure, self).__init__()
474478

@@ -563,7 +567,7 @@ class is a subclass of both BaseFigure and widgets.DOMWidget.
563567
# ------
564568
# ### Construct layout validator ###
565569
# This is the validator that handles importing Layout objects
566-
self._layout_validator = LayoutValidator()
570+
self._layout_validator = LayoutValidator
567571

568572
# ### Import Layout ###
569573
self._layout_obj = self._layout_validator.validate_coerce(
@@ -598,7 +602,7 @@ class is a subclass of both BaseFigure and widgets.DOMWidget.
598602
# ### Construct frames validator ###
599603
# This is the validator that handles importing sequences of frame
600604
# objects
601-
self._frames_validator = FramesValidator()
605+
self._frames_validator = FramesValidator
602606

603607
# ### Import frames ###
604608
self._frame_objs = self._frames_validator.validate_coerce(

0 commit comments

Comments
 (0)