422 error when batch deleting 1 record
See original GitHub issueHi! Thanks for this amazing wrapper.
I think the recent update to support the limit of ten records ids broke the ability to batch delete one record. Is this expected? Before I used to do:
record_ids = [record["id"] for record in records]
airtable.batch_delete(record_ids)
But I started getting the following error:
requests.exceptions.HTTPError: ('422 Client Error: Unprocessable Entity for url: https://api.airtable.com/v0/<app_id>/Reporting?records=recXXXXXXXXXXX', '422 Client Error: Unprocessable Entity for url: https://api.airtable.com/v0/<app_id>/Reporting?records=recXXXXXXXXXXX [Error: {\'type\': \'INVALID_RECORDS\', \'message\': \'"records" must be an array of up to 10 record IDs.\'}]')
Now I am doing
record_ids = [record["id"] for record in records]
if len(record_ids) == 1:
connection_airtable.delete(record_ids[0])
else:
connection_airtable.batch_delete(record_ids)
Not a big deal but I thought it might be useful to report this issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Fix the HTTP 422 Error - Kinsta
Unlike other HTTP errors, the HTTP 422 code will keep reappearing until you manage to troubleshoot the problem. Here's how to fix it....
Read more >Status Code 422 Unprocessable Entity - Zapier
Status Code 422 Unprocessable Entity · Missing Zap data · Why is the record I created in a previous step not being found...
Read more >What can cause 422 UnprocessableEntity while deleting a ...
The good news is that this appears to just be an incorrect response, without additional downstream effects on your account. The bad news...
Read more >422 error on delete/write · Issue #190 - GitHub
This is probably user error but I'm getting a 422 (cannot completely) error when trying to delete a file or write to existing...
Read more >Telegraf outputs.influxdb_v2 plugin Error: 422 Unprocessable ...
I am using telegraf with influxdb to write a json file through plugins. My problem is that when I start telegraf with my...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thank you for confirming this. I will try to take a look at this when I can, in the meantime if someone has the time to investigate this and prepare a PR fix I am happy to review and merge it
ugh. Thank you for reporting. Must have broken something on the last release