Skip to content

Backcheck date column joins backcheck data on the survey KEY #300

Description

@iabaako

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

  • Backcheck dates populate when survey and backcheck KEYs differ.
  • Tests use distinct survey and backcheck KEYs.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions