|
31 | 31 | "validate_sampling_condition", |
32 | 32 | "validate_sampling_configuration", |
33 | 33 | "normalize_project_config", |
34 | | - "normalize_cardinality_limit_config", |
35 | 34 | "normalize_global_config", |
36 | 35 | ] |
37 | 36 |
|
@@ -327,34 +326,6 @@ def normalize_project_config( |
327 | 326 | raise ValueError(rv) |
328 | 327 |
|
329 | 328 |
|
330 | | -def normalize_cardinality_limit_config( |
331 | | - config, |
332 | | - json_dumps: Callable[[Any], Any] = json.dumps, |
333 | | - json_loads: Callable[[str | bytes], Any] = json.loads, |
334 | | -): |
335 | | - """Normalize the cardinality limit config. |
336 | | -
|
337 | | - Normalization consists of deserializing and serializing back the given |
338 | | - cardinality limit config. If deserializing fails, throw an exception. Note that even if |
339 | | - the roundtrip doesn't produce errors, the given config may differ from |
340 | | - normalized one. |
341 | | -
|
342 | | - :param config: the cardinality limit config to validate. |
343 | | - :param json_dumps: a function that stringifies python objects |
344 | | - :param json_loads: a function that parses and converts JSON strings |
345 | | - """ |
346 | | - serialized = json_dumps(config) |
347 | | - normalized = rustcall( |
348 | | - lib.normalize_cardinality_limit_config, encode_str(serialized) |
349 | | - ) |
350 | | - rv = decode_str(normalized, free=True) |
351 | | - try: |
352 | | - return json_loads(rv) |
353 | | - except Exception: |
354 | | - # Catch all errors since json.loads implementation can change. |
355 | | - raise ValueError(rv) |
356 | | - |
357 | | - |
358 | 329 | def normalize_global_config( |
359 | 330 | config, |
360 | 331 | json_dumps: Callable[[Any], Any] = json.dumps, |
|
0 commit comments