MCPcopy Index your code
hub / github.com/plotly/dash / validate_grouping

Function validate_grouping

dash/_grouping.py:214–236  ·  view source on GitHub ↗

Validate that the provided grouping conforms to the provided schema. If not, raise a SchemaValidationError

(grouping, schema, full_schema=None, path=())

Source from the content-addressed store, hash-verified

212
213
214def validate_grouping(grouping, schema, full_schema=None, path=()):
215 """
216 Validate that the provided grouping conforms to the provided schema.
217 If not, raise a SchemaValidationError
218 """
219 if full_schema is None:
220 full_schema = schema
221
222 if isinstance(schema, (tuple, list)):
223 SchemaTypeValidationError.check(grouping, full_schema, path, (tuple, list))
224 SchemaLengthValidationError.check(grouping, full_schema, path, len(schema))
225
226 for i, (g, s) in enumerate(zip(grouping, schema)):
227 validate_grouping(g, s, full_schema=full_schema, path=path + (i,))
228 elif isinstance(schema, dict):
229 SchemaTypeValidationError.check(grouping, full_schema, path, dict)
230 SchemaKeysValidationError.check(grouping, full_schema, path, set(schema))
231 for k in schema:
232 validate_grouping(
233 grouping[k], schema[k], full_schema=full_schema, path=path + (k,)
234 )
235 else:
236 pass
237
238
239def update_args_group(g, triggered):

Calls 2

setFunction · 0.50
checkMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…