Stack position
Description
_add_date_columns
(compute.py:747-751)
takes the survey_key column from the backcheck data and joins it against
the survey KEY in the analysis:
bc_dates = backcheck_data.select(
[survey_key, pl.col(backcheck_date).alias("backcheck_date_col")]
).unique(subset=[survey_key])
result = result.join(bc_dates, on=survey_key, how="left")
Survey and backcheck submissions normally have different KEYs, so
backcheck_date_col comes back empty. It feeds the average-days figures in the
enumerator and backchecker statistics (_calculate_average_days).
Steps to reproduce
Use a project whose survey and backcheck datasets have distinct KEY values and a
configured backcheck date. The backcheck dates and the average-days statistics
are empty.
Fix
Join on the backcheck KEY ({survey_key}__BCCL) when it is present, as the
staff join does at
compute.py:703, or on
survey_id.
Acceptance criteria
Stack position
fix/300-backcheck-date-join, fromfix/299-backcheck-settings-fieldsfix/299-backcheck-settings-fields(retarget tomainonce Backcheck duplicate-handling option and target % are silently ignored #299 merges)Description
_add_date_columns(compute.py:747-751)
takes the
survey_keycolumn from the backcheck data and joins it againstthe survey KEY in the analysis:
Survey and backcheck submissions normally have different KEYs, so
backcheck_date_colcomes back empty. It feeds the average-days figures in theenumerator and backchecker statistics (
_calculate_average_days).Steps to reproduce
Use a project whose survey and backcheck datasets have distinct KEY values and a
configured backcheck date. The backcheck dates and the average-days statistics
are empty.
Fix
Join on the backcheck KEY (
{survey_key}__BCCL) when it is present, as thestaff join does at
compute.py:703, or on
survey_id.Acceptance criteria