Skip to content

fix csv parser when no separator detected#131

Open
SaInekK wants to merge 2 commits into
harmonydata:mainfrom
SaInekK:pr/csv-parser-no-separator-fallback
Open

fix csv parser when no separator detected#131
SaInekK wants to merge 2 commits into
harmonydata:mainfrom
SaInekK:pr/csv-parser-no-separator-fallback

Conversation

@SaInekK
Copy link
Copy Markdown

@SaInekK SaInekK commented May 20, 2026

Description

convert_text_to_instruments previously called pd.read_csv(sep=None) for CSV files where no separator was detected. On pandas ≥ 2.3 this raises (the auto-detection branch was removed). This change guards the CSV-parse block with csv_sep is not None, so files with no detectable separator fall through to the txt branch instead of raising.

Fixes # (no upstream issue raised — happy to file one if you'd like a tracker)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • pytest tests/ → passes; restores the 6 test_remove_*_digits_from_csv tests that fail on main under pandas 2.3+.
  • Manually tested with a one-column CSV (single header, no comma/semicolon/tab): no exception, parsed as text.

Test Configuration

  • Library version: this branch
  • OS: macOS 14
  • Toolchain: Python 3.11, pandas 2.x

Checklist

  • My PR is for one issue
  • Self-reviewed
  • No new warnings
  • Tests pass locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant