Script becomes unresponsive after deleting 10Krows.
I am attempting to delete rows from a Smartsheet that contains 16K rows. I'm using the smartsheet_client.Sheets.delete_rows(sheet_id, rows_in_chunks) method and have tried deleting in chunks of 20 and 200 rows at a time. However, the script becomes unresponsive/gets stuck after deleting 10K rows. I'm wondering if this issue could be related to memory limitations in Python or the SDK versions being used. Can you provide any insights or suggestions on how to address this problem?
Answers
-
Hi @Devi
I tried batch sizes 1,000 and 500 and got an error.
Then, batch size 100 was ok, but it took 6 minutes to delete 13,187 rows.
Batch size 300 was ok, and it deleted 13,187 rows in two minutes.😁
Here is the code I tried.
-
Hello @jmyzk_cloudsmart_jp :Thank you for your reply. The script successfully deletes all the rows when working with a sheet containing 13K rows. However, when attempting to delete rows from a sheet with 16K rows, the script gets stuck after deleting 10,000 rows. When I stop and re-run it deletes the remaining rows. I tried to delete in chunks of 20, 200...I'm wondering if this issue could be related to memory limitations or the versions of Python/SDK being used."
-
Hi @Devi
I tested with a sheet with more than 18900 rows. I was able to delete them all.
Delete 300 rows: 18900 / 300 = 63 API calls
Remaining 98 rows: 1 API calls
Total: 64 API calls
The sheet has 17 columns. Does your sheet have more columns?
-
Thank You for your reply. The sheet has 10 columns. Which versions of the Python and Smartsheet SDK are you using?
-
Python 3.10.12
smartsheet-python-sdk-3.0.2
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives