question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

422 error when batch deleting 1 record

See original GitHub issue

Hi! 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gtalaricocommented, Sep 20, 2020

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

1reaction
gtalaricocommented, Aug 22, 2020

ugh. Thank you for reporting. Must have broken something on the last release

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found