A JSON dataset with nested objects crashes the CLI with a raw traceback
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #853 by @Tiyatrotist — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 83/100
Research direction
Start with the JSON path in faircode/loaders.py and the failing profiling path in faircode/profiler.py; reproduce using the nested JSON example and python3 -m faircode profile nested.json. Add a CLI test covering the input and expected behavior: either flatten loc into loc.state or exit with a clear one-line error instead of a traceback.
Written by the indexing model from the issue text.
Description
Where: faircode/loaders.py JSON path, faircode/profiler.py.
Current gap: A records-style JSON file whose values are objects makes pandas produce dict cells, and profiling dies in unique() with TypeError: unhashable type: 'dict' and a full traceback - unlike every other bad-input path, which exits 2 with a one-line error:. The web engine handles the same file.
Repro:
$ echo '[{"sex":"M","loc":{"state":"TX"}},{"sex":"F","loc":{"state":"CA"}}]' > nested.json
$ python3 -m faircode profile nested.json
Traceback (most recent call last): ... TypeError: unhashable type: 'dict'
Suggested approach: flatten with pandas.json_normalize (loc.state, matching what a user expects) or reject with a clear error; add a CLI test.
- Dominant language
- HTML
- Stars
- 47
- Forks
- 45
- Avg merge
- 2h 47m
- Merged PRs (30d)
- 85
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
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
--proxy-hints-with misreads a held-out column whose name contains a colon since the join-key syntaxOpenbug good first issue
Difficulty 3/5 Half a day Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
`check_java_version()` fails when Java path contains spaces (Windows / Git Bash, `C:\Program Files`)Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FinanceFlash/unvibecode#218 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OktoLabsAI/okto-pulse#111 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day