parse_reference's blank and None share cells have no end-to-end test
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, pandas, python
- Domain
- testing
Research direction
Start with parse_reference() in faircode/profiler.py (lines 548-553) and run the repro from the issue to confirm that NaN, None and inf cells are dropped. Then look at the --reference option in faircode/cli.py and the existing tests in tests/test_profiler.py and tests/test_cli.py. Done means a parametrised Python test over nan, None and inf passes, a CLI test with a blank share field shows the baseline without that group and no nan in the output, and the web parseReference has a JSON-null case.
Written by the indexing model from the issue text.
Description
Where: faircode/profiler.py parse_reference() (the float(value) guard and the finite check, lines 548-553), faircode/cli.py (--reference), tests/test_profiler.py, tests/test_cli.py.
Current gap: #1002 made both engines skip unreadable shares. The numeric cases were tested with strings (n/a, nan, inf) but the most common real one is a blank cell in a reference CSV, which pandas reads as a float NaN (or None in JSON). Coverage shows the TypeError path and the non-finite guard still never run from a numeric cell, and nothing checks that faircode profile --reference ref.csv with a blank share ignores that row instead of using nan.
Repro:
>>> import pandas as pd; from faircode.profiler import parse_reference
>>> parse_reference(pd.DataFrame({"column": ["c"] * 4, "group": list("abcd"), "share": [0.5, float("nan"), None, float("inf")]}))
{'c': {'a': 0.5}} # correct, but no test pins it
Suggested approach: parametrise a Python test over nan, None and inf cells, add a CLI test with a reference CSV that has an empty share field (expecting the baseline without that group and no nan in the output), and the same JSON-null case for the web parseReference.
- Dominant language
- HTML
- Stars
- 47
- Forks
- 45
- Avg merge
- 3h 24m
- Merged PRs (30d)
- 72
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 82/100
Maintainers usually reply within 1 day
-
XLSX workbooks that use the 1904 date system get dates four years and a day early in the web engineOpenbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 66/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 1 day ago. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yakew7/Fair-Code#1045 · 2 comments · 1 assignee ·
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 1 day ago. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yakew7/Fair-Code#1036 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github/gh-aw-firewall#10364 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
comet-ml/opik#9089 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
spec-kitty/spec-kitty#6560 ·
Maintainers usually reply within 1 day
-
test(coding-agent): python-tool-builtin tests time out on dev after #7023 state-writer append changeOpenbug P1
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Yeachan-Heo/gajae-code#7027 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 89/100
Riloox/hostkind-open#43 ·