mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-24 06:50:57 +02:00
Airtable improvement
This commit is contained in:
parent
2232702e99
commit
3b214133a8
@ -200,7 +200,10 @@ class AirtableConnector(LoadConnector):
|
|||||||
|
|
||||||
table = self.airtable_client.table(self.base_id, self.table_name_or_id)
|
table = self.airtable_client.table(self.base_id, self.table_name_or_id)
|
||||||
table_id = table.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()
|
table_schema = table.schema()
|
||||||
# have to get the name from the schema, since the table object will
|
# have to get the name from the schema, since the table object will
|
||||||
@ -216,8 +219,7 @@ class AirtableConnector(LoadConnector):
|
|||||||
break
|
break
|
||||||
|
|
||||||
record_documents: list[Document] = []
|
record_documents: list[Document] = []
|
||||||
for page in record_pages:
|
for record in records:
|
||||||
for record in page:
|
|
||||||
record_id = record["id"]
|
record_id = record["id"]
|
||||||
fields = record["fields"]
|
fields = record["fields"]
|
||||||
sections: list[Section] = []
|
sections: list[Section] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user