Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve error message #19546

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py-polars/polars/io/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _check_empty(
if context in ("StringIO", "BytesIO") and read_position
else ""
)
msg = f"empty CSV data from {context}{hint}"
msg = f"empty data from {context}{hint}"
raise NoDataError(msg)
return b

Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/io/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_csv_null_values() -> None:
# advanced; reading again will raise NoDataError, so we provide a hint
# in the error string about this, suggesting "seek(0)" as a possible fix...
with pytest.raises(
NoDataError, match=r"empty CSV data .* position = 20; try seek\(0\)"
NoDataError, match=r"empty data .* position = 20; try seek\(0\)"
):
pl.read_csv(f)

Expand Down
Loading