Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mwojtyczka committed Dec 2, 2024
1 parent 653bcc0 commit 605594e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/databricks/labs/dqx/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 605594e

Please sign in to comment.