Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

compare --fail-on-drift exits 0 when nothing could be compared, while profile --fail-under refuses to pass

Closed Beginner friendly
#1,017 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Start with the --fail-under guard in the profile branch of faircode/cli.py (around lines 706-716), which already refuses to pass when no demographic columns are detected, and compare the compare branch's --fail-on-drift handling. Reproduce both commands from the issue with a header-only CSV and a file with no demographic columns. Done means compare --fail-on-drift exits 2 with "cannot apply --fail-on-drift: no dimension to compare" in those cases, with tests added to tests/test_cli.py and the rule documented in faircode/SPEC.md section 8.

Written by the indexing model from the issue text.

Description

bug help wanted

Where: faircode/cli.py (the compare branch's --fail-on-drift handling; compare the --fail-under branch of profile, lines 706-716), tests/test_cli.py, faircode/SPEC.md section 8.

Current gap: profile --fail-under N exits 2 with "cannot apply --fail-under: no demographic columns detected" when there is no score to compare, so a CI gate cannot pass vacuously. compare --fail-on-drift has no such guard: two datasets with no detectable dimension (a wrong file, a renamed column set) report no drift and exit 0, and a gate on drift silently stops gating.

Repro:

$ printf 'x,y\n1,2\n' > nodims.csv
$ python3 -m faircode profile nodims.csv --fail-under 50; echo "exit=$?"
error: cannot apply --fail-under: no demographic columns detected
exit=2
$ python3 -m faircode compare nodims.csv nodims.csv --fail-on-drift; echo "exit=$?"
exit=0        # also with two header-only files

Suggested approach: when no dimension is compared on both sides (and none was added or removed), exit 2 with "cannot apply --fail-on-drift: no dimension to compare", document it in SPEC section 8, and test both the no-dimension and the header-only case.

Dominant language
HTML
Stars
47
Forks
45
Avg merge
3h 4m
Merged PRs (30d)
83

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yakew7/Fair-Code

All issues in yakew7/Fair-Code

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.