compare --fail-on-drift exits 0 when nothing could be compared, while profile --fail-under refuses to pass
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from yakew7/Fair-Code
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Numeric column headers keep their type in Python (the integer 2020) and are text in the web enginePossibly taken @snehal1931 claimed this 4 days ago. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yakew7/Fair-Code#1045 · 2 comments ·
Maintainers usually reply within 1 day
-
JSON string cells "NA" and "" are missing in the web engine and ordinary values in PythonPossibly taken @snehal1931 claimed this 4 days ago. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yakew7/Fair-Code#1036 · 2 comments ·
Maintainers usually reply within 1 day
-
check_issue_refs fails a pull request that says it closes an issue the pull request itself closesOpenenhancement help wanted
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
level/task type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
wazuh/wazuh-installation-assistant#1177 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NCAR/miles-credit#526 ·
-
status:needs-review
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Gentleman-Programming/engram#2065 ·
Maintainers usually reply within 1 day