From 09aa1eac03bf0d70d387d3239bd7407db9d985b3 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 17 Aug 2023 00:56:33 +0200 Subject: [PATCH] Airbyte loaders: Fix last_state getter (#9314) This PR fixes the Airbyte loaders when doing incremental syncs. The notebooks are calling out to access `loader.last_state` to get the current state of incremental syncs, but this didn't work due to a refactoring of how the loaders are structured internally in the original PR. This PR fixes the issue by adding a `last_state` property that forwards the state correctly from the CDK adapter. --------- Co-authored-by: Bagatur --- libs/langchain/langchain/document_loaders/airbyte.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/langchain/langchain/document_loaders/airbyte.py b/libs/langchain/langchain/document_loaders/airbyte.py index aec832248d..7f9d4b4407 100644 --- a/libs/langchain/langchain/document_loaders/airbyte.py +++ b/libs/langchain/langchain/document_loaders/airbyte.py @@ -60,6 +60,10 @@ class AirbyteCDKLoader(BaseLoader): stream_name=self._stream_name, state=self._state ) + @property + def last_state(self) -> Any: + return self._integration.last_state + class AirbyteHubspotLoader(AirbyteCDKLoader): """Load from `Hubspot` using an `Airbyte` source connector."""