split_held_out_encoding has an unreachable branch and an untested empty-suffix error
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
Research direction
Read faircode/proxy.py around split_held_out_encoding() and the related tests in tests/test_proxy.py. Add coverage for an empty encoding suffix, an unknown codec, an @ in the path, and missing join key columns in either file; remove the unreachable branch. Run the focused proxy tests and confirm these cases pass.
Written by the indexing model from the issue text.
Description
Where: faircode/proxy.py split_held_out_encoding() (#914), tests/test_proxy.py.
Current gap: the function does value, marker, encoding = rest.rpartition("@") only after "@" in rest, so marker is always "@" and the if not marker: branch can never run (line 204). The "expected @ENCODING" error for a trailing @ (line 206) has no test either.
Repro:
$ python3 -m pytest tests -q -m "not slow" --cov=faircode.proxy --cov-report=term-missing | grep proxy.py
faircode/proxy.py ... 204, 206, 370, 376
>>> split_held_out_encoding("h.csv=race@")
ValueError: invalid held-out encoding in 'h.csv=race@': expected @ENCODING # works, but no test
Suggested approach: delete the dead branch, add tests for the empty suffix, an unknown codec and an @ inside the path, and cover the two other uncovered raises (lines 370, 376: a missing join key column in either file).
- Dominant language
- HTML
- Stars
- 47
- Forks
- 45
- Avg merge
- 3h 1m
- Merged PRs (30d)
- 53
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
-
enhancement good first issue
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 82/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/datafusion-comet#7001 ·
Maintainers usually reply within 1 day
-
data docs
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pacocartones/market-data-sanity-checker#143 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
neuroinformatics-unit/movement#1155 ·
Maintainers usually reply within 3 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
osmlab/name-suggestion-index#12969 ·
Maintainers usually reply within 1 day