Delimiter sniffing in the loaders has uncovered edge cases (quoted fields, stray quotes, empty samples)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, python
Research direction
Read faircode/loaders.py at _logical_row_delimiter_counts() and _sniff_delimiter(), then review the existing cases in tests/test_loaders.py. Add table driven cases for empty samples, quote boundaries, stray quotes, ties, quoted delimiters and single column input, and feed the same inputs to E.sniffDelimiter in a parity test. Done means the edge cases are covered and Python and web results agree.
Written by the indexing model from the issue text.
Description
Where: faircode/loaders.py _logical_row_delimiter_counts() / _sniff_delimiter() (lines 107, 119, 130, 137, 142), tests/test_loaders.py.
Current gap: the logic that counts delimiters per logical row (so a quoted newline does not split a row) and picks the delimiter has branches no test reaches: an empty sample, a quote that closes at the end of the sample, a stray quote, and the tie-breaking when two delimiters score the same. The web engine has its own sniffDelimiter and the two are meant to agree.
Repro:
$ python3 -m pytest tests -q -m "not slow" --cov=faircode.loaders --cov-report=term-missing | grep "loaders.py"
faircode/loaders.py ... 92% ... 58-59, 107, 119, 130, 137, 142
Suggested approach: table-driven tests of _sniff_delimiter over those inputs (comma, tab, semicolon, pipe, ties, quoted delimiters, a single column), with the same inputs fed to E.sniffDelimiter in a parity test.
- Dominant language
- HTML
- Stars
- 47
- Forks
- 45
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 54
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 good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 3/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug enhancement help wanted
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 3/5 1-2 days Newbie friendliness 50/100
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/rocketmq-dashboard#6896 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
data
Difficulty 1/5 Under an hour Newbie friendliness 74/100
gaseous-project/hasheous#637 ·
Maintainers usually reply within 1 day
-
Grouping VCF export never writes the link INFO field (second link() replaces it)Possibly taken A pull request linked to this issue is open or already merged. Openbug classification
Difficulty 1/5 Under an hour Newbie friendliness 90/100
SACGF/variantgrid#2259 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine-us#10262 ·
Maintainers usually reply within 2 days