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(python): Ensure NoDataError raised consistently between engines for Excel reads #19712

Merged

Conversation

max-muoto
Copy link
Contributor

This PR fixes #19711 ensuring that a no data error is raised for Calamine reads even when schema overrides are provided.

@max-muoto max-muoto changed the title Fix NoDataError for Excel Reads with Calamine fix: Fix NoDataError for Excel Reads with Calamine Nov 10, 2024
@github-actions github-actions bot added title needs formatting fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Nov 10, 2024
@@ -997,15 +997,15 @@ def _read_spreadsheet_calamine(
):
df.columns = [f"column_{i}" for i in range(1, len(df.columns) + 1)]

df = _drop_null_data(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Drop null data first, which will potentially raise a no data error.

@max-muoto max-muoto marked this pull request as draft November 10, 2024 00:31
@max-muoto max-muoto marked this pull request as ready for review November 10, 2024 00:32
@max-muoto max-muoto changed the title fix: Fix NoDataError for Excel Reads with Calamine fix: Fix NoDataError for Excel Reads Nov 10, 2024
@alexander-beedie
Copy link
Collaborator

Looks good to me; nice extension on the existing test 👌

@alexander-beedie alexander-beedie changed the title fix: Fix NoDataError for Excel Reads fix(python): Ensure NoDataError raised consistently between engines for Excel reads Nov 10, 2024
@alexander-beedie alexander-beedie removed the rust Related to Rust Polars label Nov 10, 2024
@alexander-beedie alexander-beedie merged commit 2c6bae1 into pola-rs:main Nov 10, 2024
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent Empty File Behavior with read_excel for Calamine
2 participants