Skip to content

[Python] Don't skip a delimiter right after an escaped one in ReadFromText - #40460

Merged
damccorm merged 2 commits into
apache:masterfrom
anishmehta24:fix/textio-escaped-delimiter
Oct 8, 2026
Merged

damccorm merged 2 commits into
apache:masterfrom
anishmehta24:fix/textio-escaped-delimiter

Conversation

@anishmehta24

Copy link
Copy Markdown
Contributor

With escapechar set, ReadFromText skipped a delimiter that comes right after an escaped one, so b'a\\\n\nb\n' read as ['a\\\n\nb'] instead of ['a\\\n', 'b'] (same with custom delimiters).

_find_separator_bounds resumed the search one byte past the escaped delimiter; it now resumes right after it. Added a test that fails on master; the TextSourceTest tests in textio_test.py pass.

fixes #40459

Written with help from Claude.


  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

ReadFromText with escapechar merged the next record into the current one.
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.55%. Comparing base (69bdf5f) to head (1edd338).
⚠️ Report is 44 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40460       +/-   ##
=============================================
+ Coverage     59.04%   79.55%   +20.51%     
=============================================
  Files          2797      487     -2310     
  Lines        280750    82225   -198525     
  Branches      12488        0    -12488     
=============================================
- Hits         165764    65413   -100351     
+ Misses       108540    16812    -91728     
+ Partials       6446        0     -6446     
Flag Coverage Δ
go ?
java ?
python 79.55% <100.00%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@damccorm damccorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this LGTM

@damccorm
damccorm merged commit 0f106b3 into apache:master Oct 8, 2026
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ReadFromText with escapechar skips a delimiter that comes right after an escaped one

2 participants