Commit 6f6dc913 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Simplify code

parent 42a5b41a
...@@ -108,15 +108,12 @@ def validate(source, schema, **options): ...@@ -108,15 +108,12 @@ def validate(source, schema, **options):
] ]
# Dynamically add custom check based on schema needs # Dynamically add custom check based on schema needs
custom_checks_config = schema.get("custom_checks") for cc_conf in schema.get("custom_checks", []):
if custom_checks_config: cc_name = cc_conf["name"]
# extra_checks = [] if cc_name in available_checks:
for cc_conf in custom_checks_config: cc_class = available_checks[cc_name]
cc_name = cc_conf["name"] cc_descriptor = cc_conf["params"]
if cc_name in available_checks: extra_checks.append(cc_class(cc_descriptor))
cc_class = available_checks[cc_name]
cc_descriptor = cc_conf["params"]
extra_checks.append(cc_class(cc_descriptor))
# Merge options to pass to frictionless # Merge options to pass to frictionless
validate_options = { validate_options = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment