Skip to content

IEBP008: duplicate_filter_acknowledged

Every filter_duplicate_ids() call states how many duplicates it drops and links the upstream report.

Category: best_practices ยท Applies to: eval, helper

What it does

Flags each filter_duplicate_ids(...) call that lacks a max_duplicates= keyword, lacks a reason= keyword, or gives a literal reason with no http:// or https:// URL in it. A reason passed as a variable is taken at face value, as is **kwargs. One diagnostic per call.

Why is this bad?

Dropping samples that share an id is only safe when they are the same record twice. A call with no count is a workaround nobody has measured, and a reason with no link is a defect nobody upstream knows about; both let a bad id key silently truncate the dataset, which is how WorldSense lost half its trials. The count bounds the damage a revision bump can do and the link is the evidence a reviewer can check.

Example

dataset = filter_duplicate_ids(dataset)

Use instead:

dataset = filter_duplicate_ids(
    dataset,
    max_duplicates=11,
    reason="8 groups of identical rows, see https://github.com/org/repo/issues/268",
)

See also

Suppress on a line with # inspect-evals-lint: ignore[IEBP008] or ignore[duplicate_filter_acknowledged]; select or ignore it in configuration by either, or by the prefix IEBP.