diff --git a/hlink/linking/core/comparison.py b/hlink/linking/core/comparison.py index 64bdfc6..1ad9069 100755 --- a/hlink/linking/core/comparison.py +++ b/hlink/linking/core/comparison.py @@ -32,22 +32,23 @@ def _get_comp_leaf(comp: dict[str, Any], comp_leaves: list[dict[str, Any]]) -> N return comp_leaves -def generate_comparisons(comp, features, id_col): +def generate_comparisons( + comp: dict[str, Any], features: list[dict[str, Any]], id_col: str +) -> str: """Creates the comparison SQL clause given a comparison and a list of comparison features. Parameters ---------- - comp: dictionary + comp: the config dictionary containing the comparison definition - features: dictionary - the config dictionary containing the comparison features - id_col: string + features: + the config list containing the comparison features + id_col: the id column Returns ------- - A string of the sql clause to be used for comparison - filtering after blocking. + The sql clause to be used for comparison filtering after blocking. """ if comp != {}: if "comp_a" in comp: diff --git a/hlink/tests/core/comparison_test.py b/hlink/tests/core/comparison_test.py index 97dbef4..358c215 100644 --- a/hlink/tests/core/comparison_test.py +++ b/hlink/tests/core/comparison_test.py @@ -83,7 +83,7 @@ def test_generate_comparisons_empty_input() -> None: generate_comparisons() returns an empty string for empty input. """ comparisons = {} - features = {} + features = [] id_col = "" assert generate_comparisons(comparisons, features, id_col) == ""