Skip to content

Commit 5898ae7

Browse files
committedJun 29, 2022
fix for flake8 failure
1 parent 3133ab1 commit 5898ae7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎statistical_methods_library/estimation.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ def estimate(
194194
.groupBy([period_col, strata_col])
195195
.agg(count(col(sample_marker_col)))
196196
)
197-
death_sample = (
197+
if (
198198
death_df.join(sample_df, ["period", "strata"], "left")
199199
.fillna(0, ["count(sample_inclusion_marker)"])
200200
.filter(
201201
(col("count(death_marker)")) > (col("count(sample_inclusion_marker)"))
202202
)
203-
)
204-
if death_sample.count():
205-
raise ValidationError(f"The death count must be less than sample count.")
203+
.count()
204+
) >= 1:
205+
raise ValidationError("The death count must be less than sample count.")
206206

207207
# --- prepare our working data frame ---
208208
col_list = [

0 commit comments

Comments
 (0)
Please sign in to comment.