From 605594eaa439f199daacc1802d4925888701f5b7 Mon Sep 17 00:00:00 2001 From: Marcin Wojtyczka Date: Mon, 2 Dec 2024 12:31:42 +0100 Subject: [PATCH] fmt --- src/databricks/labs/dqx/engine.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/databricks/labs/dqx/engine.py b/src/databricks/labs/dqx/engine.py index 2432d3b..78b8058 100644 --- a/src/databricks/labs/dqx/engine.py +++ b/src/databricks/labs/dqx/engine.py @@ -264,7 +264,9 @@ def _validate_check_dict(check: dict, errors: list[str], glbs: dict[str, Any] | return errors @staticmethod - def _validate_check_block(check_block: dict, check: dict, errors: list[str], glbs: dict[str, Any] | None) -> list[str]: + def _validate_check_block( + check_block: dict, check: dict, errors: list[str], glbs: dict[str, Any] | None + ) -> list[str]: """ Validates a check block within a configuration. @@ -311,8 +313,8 @@ def _validate_arguments(arguments: dict, func: Callable, check: dict, errors: li # empty col_names list is skipped in the build_checks_by_metadata method. Hence not raising error to make it compatible with the existing behavior. elif len(arguments["col_names"]) > 0: arguments = { - 'col_name' if k == 'col_names' else k: arguments['col_names'][0] if k == 'col_names' else v - for k, v in arguments.items() + 'col_name' if k == 'col_names' else k: arguments['col_names'][0] if k == 'col_names' else v + for k, v in arguments.items() } errors = DQEngine._validate_func_args(arguments, func, check, errors) else: @@ -358,7 +360,7 @@ def cached_signature(func): f"Argument '{arg}' should be of type '{expected_type.__name__}' for function '{func.__name__}' in the 'arguments' block: {check}" ) return errors - + @staticmethod def build_checks_by_metadata(checks: list[dict], glbs: dict[str, Any] | None = None) -> list[DQRule]: """Build checks based on check specification, i.e. function name plus arguments.