Skip to content

Commit 03d85de

Browse files
bmaranvillegvwilson
authored andcommitted
use ValidatorCache for generated Layout validators
1 parent 1b99411 commit 03d85de

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

codegen/datatypes.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,11 @@ class {datatype_class}(_{node.name_base_datatype}):\n"""
130130
"""
131131
)
132132

133-
subplot_validator_names = [n.name_validator_class for n in subplot_nodes]
134-
135-
validator_csv = ", ".join(subplot_validator_names)
136133
subplot_dict_str = (
137134
"{"
138135
+ ", ".join(
139-
f"'{subname}': {valname}"
140-
for subname, valname in zip(subplot_names, subplot_validator_names)
136+
f"\"{subname}\": ValidatorCache.get_validator(\"layout\", \"{subname}\")"
137+
for subname in subplot_names
141138
)
142139
+ "}"
143140
)
@@ -153,7 +150,7 @@ def _subplotid_validators(self):
153150
-------
154151
dict
155152
\"\"\"
156-
from plotly.validators.layout import ({validator_csv})
153+
from plotly.validator_cache import ValidatorCache
157154
158155
return {subplot_dict_str}
159156

0 commit comments

Comments
 (0)