Get params for the validator instance for the supplied node and add them to the store. Parameters ---------- node : PlotlyNode The datatype node (node.is_datatype must evaluate to true) for which to build a validator class store : dict Dictionary to
(node: PlotlyNode, store: dict)
| 6 | |
| 7 | |
| 8 | def get_validator_params(node: PlotlyNode, store: dict): |
| 9 | """ |
| 10 | Get params for the validator instance for the supplied node |
| 11 | and add them to the store. |
| 12 | |
| 13 | Parameters |
| 14 | ---------- |
| 15 | node : PlotlyNode |
| 16 | The datatype node (node.is_datatype must evaluate to true) for which |
| 17 | to build a validator class |
| 18 | store : dict |
| 19 | Dictionary to store the JSON data for the validator |
| 20 | Returns |
| 21 | ------- |
| 22 | None |
| 23 | """ |
| 24 | assert isinstance(store, dict) |
| 25 | assert node.is_datatype |
| 26 | |
| 27 | raw_params = node.get_validator_params() |
| 28 | params = dict([(k, eval(v)) for k, v in raw_params.items()]) |
| 29 | superclass_name = node.name_base_validator.split(".")[-1] |
| 30 | |
| 31 | key = ".".join(node.parent_path_parts + (node.name_property,)) |
| 32 | store[key] = {"params": params, "superclass": superclass_name} |
| 33 | |
| 34 | |
| 35 | def get_data_validator_params(base_trace_node: TraceNode, store: dict): |
no test coverage detected