-
Notifications
You must be signed in to change notification settings - Fork 952
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
Adds multiple rows with index #734
Conversation
Adds multiple rows to the worksheet at the specified index and populates it with values
Thank you very much for your contribution. My bad I've missed this PR and added Let me know if you're interested in changing the PR. |
It would be very nice if the |
@garethsb-sony very good point. Thank you for the suggestion. For the record, here's the link to @tr-fi let me know if you need help with reworking the PR. |
Thanks, @burnash ! (I assume |
@garethsb-sony yes, exactly. I'm also trying to figure out if the scalar versions of these methods are still needed. Maybe it would be a good idea to deprecate the scalar versions and reduce the API surface a bit. |
change method name
@burnash You right insert_rows is more reasonable. So I changed the method name to insert_rows. |
fix indentation line wrong
"range": { | ||
"sheetId": self.id, | ||
"dimension": "ROWS", | ||
"startIndex": index - 1, |
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.
It looks like there's a problem with insert indices.
Steps to reproduce:
- I have a sheet with consecutive values:
- I call
wks.insert_rows([['r1.1','r1.2'],['r2.1', 'r2.2']], index=3)
Where wks
is my worksheet.
- I get
Where the expected result is 1, 2, r1.1, r2.1, 3, 4, etc in the column A.
It looks like the method overwrites the cell with value "3".
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.
Sorry I did not test thoroughly. I fixed it but need you test again
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.
No problem, thank you for fast response
Fix index not working exactly
Adds multiple rows to the worksheet at the specified index and populates it with values