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 read_excel and read_ods return identical frames across all engines when given empty spreadsheet tables #16802

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Jun 7, 2024

Ref: #16408 (though doesn't close it - related, but not the same).

Extended test coverage to handle both the "no data" and "no rows" cases to ensure that we return identical frames in all cases (eg: if we have column names but no table rows we assign String dtype to empty frame cols).

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Jun 7, 2024
@alexander-beedie alexander-beedie added the A-io-excel Area: reading/writing Excel files label Jun 7, 2024
@alexander-beedie alexander-beedie force-pushed the empty-spreadsheet-dtype-consistency branch from 319b372 to aa57cb8 Compare June 7, 2024 10:12
…es across all engines when given empty spreadsheet tables
@alexander-beedie alexander-beedie force-pushed the empty-spreadsheet-dtype-consistency branch from aa57cb8 to 20fda4e Compare June 7, 2024 22:14
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.38%. Comparing base (38149d6) to head (20fda4e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16802      +/-   ##
==========================================
- Coverage   81.39%   81.38%   -0.02%     
==========================================
  Files        1424     1424              
  Lines      187623   187625       +2     
  Branches     2691     2692       +1     
==========================================
- Hits       152719   152690      -29     
- Misses      34409    34440      +31     
  Partials      495      495              

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

@ritchie46
Copy link
Member

Can we write ods files? Otherwise I'd rather have that we write them on session instead of adding to the repo.

@alexander-beedie
Copy link
Collaborator Author

alexander-beedie commented Jun 9, 2024

Can we write ods files? Otherwise I'd rather have that we write them on session instead of adding to the repo.

While we can now read ods, xls, xlsb and xlsx (and -I think- xlsm), we can only write to xlsx.

@ritchie46
Copy link
Member

Alright, repo it is then. 👍

@ritchie46 ritchie46 merged commit 0f1eb18 into pola-rs:main Jun 10, 2024
15 checks passed
@alexander-beedie alexander-beedie deleted the empty-spreadsheet-dtype-consistency branch June 18, 2024 06:14
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 2024
…es across all engines when given empty spreadsheet tables (pola-rs#16802)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io-excel Area: reading/writing Excel files fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants