Skip to content

Commit

Permalink
Merge pull request #265 from moj-analytical-services/warn_num_levels
Browse files Browse the repository at this point in the history
Warn num levels
  • Loading branch information
RobinL authored Jan 12, 2022
2 parents c91aa8f + c1d8c47 commit a4b836d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "splink"
version = "2.1.1"
version = "2.1.2"
description = "Implementation of Fellegi-Sunter's canonical model of record linkage in Apache Spark, including EM algorithm to estimate parameters"
authors = ["Robin Linacre <robinlinacre@hotmail.com>", "Sam Lindsay", "Theodore Manassis"]
license = "MIT"
Expand Down
10 changes: 9 additions & 1 deletion splink/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,20 @@ def _complete_comparison_levels(col_settings):
if "-1" not in keys:

warnings.warn(
"No -1 level found in case statement."
"\nNo -1 level found in case statement."
" You usually want to use -1 as the level for the null value."
" e.g. WHEN col_l is null or col_r is null then -1"
f" Case statement is:\n {col_settings['case_expression']}."
)

if "num_levels" in col_settings:
if col_settings["num_levels"] != cc.num_levels:
warnings.warn(
f"\nnum_levels specified in settings is {col_settings['num_levels']}, "
f"but the number of levels in the case statement excluding the null level is {cc.num_levels}"
f"\nCase statement is:\n {col_settings['case_expression']}."
)


def _complete_col_name(col_settings):

Expand Down

0 comments on commit a4b836d

Please sign in to comment.