Skip to content

Commit

Permalink
raise error if user passes list to block_on
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinL committed Jan 29, 2024
1 parent bcc375e commit 927cccb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions splink/blocking_rule_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ def block_on(
salting_partitions=None,
arrays_to_explode=None,
) -> BlockingRuleCreator:
if isinstance(col_names_or_exprs[0], list):
raise TypeError(
"block_on no longer accepts a list as the first argument. "
"Please pass individual column names or expressions as separate arguments"
' e.g. block_on("first_name", "dob") not block_on(["first_name", "dob"])'
)

if len(col_names_or_exprs) == 1:
br = ExactMatchRule(col_names_or_exprs[0])
else:
Expand Down

0 comments on commit 927cccb

Please sign in to comment.