-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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): Throw exception if dataframe is too large to be compatible with Excel #20900
base: main
Are you sure you want to change the base?
fix(python): Throw exception if dataframe is too large to be compatible with Excel #20900
Conversation
…e max rows are exceeded for Excel
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #20900 +/- ##
==========================================
+ Coverage 79.76% 79.77% +0.01%
==========================================
Files 1569 1569
Lines 222895 222911 +16
Branches 2573 2577 +4
==========================================
+ Hits 177782 177827 +45
+ Misses 44521 44492 -29
Partials 592 592 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to contribute!
A couple of notes:
- You need to account for the headers, which will also write a row, not just the data (so we will write +1 rows when
include_headers
is True). - The table can start from a cell other than A1, so you also need to account for a starting offset (see the
position
parameter). - While we're at it we should probably also check the max width too; Excel's max there is 16384 columns 🤔
…cal offset given in the form of an int tuple only], and checked to ensure max Excel cols are also not exceeded
Thank you for your feedback and guidance. I've made the changes. With respect to the second point, it appears that |
The |
fixes #20870
I have what I believe is a working solution and it is passing all the pre-existing tests. However, I don't know how to test whether my change is creating the expected behavior or not (when the dataframe is too large to be compatible with Excel, an exception should be thrown).
This is my very first commit to an open-source project, so I apologize in advance for any mistakes I might have made and I look forward to hearing any and all feedback.