Fixed indexing issues with Salesforce

This commit is contained in:
hagen-danswer 2024-12-29 16:15:43 -08:00 committed by Chris Weaver
parent 27acd3387a
commit 3ec338307f
2 changed files with 4 additions and 1 deletions

View File

@ -265,13 +265,15 @@ class SalesforceConnector(LoadConnector, PollConnector, SlimConnector):
time_filter_query = _build_time_filter_for_salesforce(start, end)
for parent_object_type in self.parent_object_list:
logger.debug(f"Processing: {parent_object_type}")
logger.info(f"Processing parent object type: {parent_object_type}")
all_ids = self._get_parent_object_ids(parent_object_type, time_filter_query)
logger.info(f"Found {len(all_ids)} IDs for {parent_object_type}")
id_batches = batch_list(all_ids, _MAX_ID_BATCH_SIZE)
# Generate all queries we'll need
queries = list(self._generate_query_per_parent_type(parent_object_type))
logger.info(f"Generated {len(queries)} queries for {parent_object_type}")
yield from self._batch_retrieval(id_batches, queries)
def load_from_state(self) -> GenerateDocumentsOutput:

View File

@ -110,6 +110,7 @@ def _field_value_is_child_object(field_value: dict) -> bool:
isinstance(field_value, OrderedDict)
and "records" in field_value.keys()
and isinstance(field_value["records"], list)
and len(field_value["records"]) > 0
and "Id" in field_value["records"][0].keys()
)