From 5852793f3d697a4f94e09afbb9b067363f06c2e8 Mon Sep 17 00:00:00 2001 From: Yanchuan Sim Date: Tue, 11 Aug 2020 00:04:15 +0800 Subject: [PATCH] Fix critical bug with `batch_update` not using chunked records --- airtable/__version__.py | 2 +- airtable/airtable_new.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airtable/__version__.py b/airtable/__version__.py index 86def530..785e84c2 100644 --- a/airtable/__version__.py +++ b/airtable/__version__.py @@ -1,4 +1,4 @@ -__version__ = "0.2" +__version__ = "0.3" __name__ = "python-airtable" __description__ = "Python module for accessing Airtable (largely based on the original airtable-python-wrapper)." __url__ = "https://github.com/fivehealth/python-airtable" diff --git a/airtable/airtable_new.py b/airtable/airtable_new.py index 58bb1960..44c4cfc4 100644 --- a/airtable/airtable_new.py +++ b/airtable/airtable_new.py @@ -88,7 +88,7 @@ def batch_update(self, records, typecast=True, destructive=False): request_func = self._put if destructive else self._patch for chunk in self._chunk(records, self.MAX_RECORDS_PER_REQUEST): - new_records = [{'id': record_id, 'fields': fields} for record_id, fields in records] + new_records = [{'id': record_id, 'fields': fields} for record_id, fields in chunk] response = request_func(self.url_table, json_data={'records': new_records, 'typecast': typecast})