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

parse_reference's blank and None share cells have no end-to-end test

Closed
#1,028 0 comments 0 reactions 0 assignees View on GitHub

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

enhancement good first issue

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

  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 Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.