Airtable improvement

This commit is contained in:
Weves 2025-01-02 17:49:07 -08:00 committed by Chris Weaver
parent 2232702e99
commit 3b214133a8

View File

@ -200,7 +200,10 @@ class AirtableConnector(LoadConnector):
table = self.airtable_client.table(self.base_id, self.table_name_or_id)
table_id = table.id
record_pages = table.iterate()
# due to https://community.airtable.com/t5/development-apis/pagination-returns-422-error/td-p/54778,
# we can't user the `iterate()` method - we need to get everything up front
# this also means we can't handle tables that won't fit in memory
records = table.all()
table_schema = table.schema()
# have to get the name from the schema, since the table object will
@ -216,8 +219,7 @@ class AirtableConnector(LoadConnector):
break
record_documents: list[Document] = []
for page in record_pages:
for record in page:
for record in records:
record_id = record["id"]
fields = record["fields"]
sections: list[Section] = []