diff --git a/backend/onyx/connectors/salesforce/connector.py b/backend/onyx/connectors/salesforce/connector.py index d8b3c3bd7..26524e9a0 100644 --- a/backend/onyx/connectors/salesforce/connector.py +++ b/backend/onyx/connectors/salesforce/connector.py @@ -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: diff --git a/backend/onyx/connectors/salesforce/doc_conversion.py b/backend/onyx/connectors/salesforce/doc_conversion.py index 09833a123..e0b8b861f 100644 --- a/backend/onyx/connectors/salesforce/doc_conversion.py +++ b/backend/onyx/connectors/salesforce/doc_conversion.py @@ -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() )