mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-05-19 16:20:05 +02:00
Fixed indexing issues with Salesforce
This commit is contained in:
parent
27acd3387a
commit
3ec338307f
@ -265,13 +265,15 @@ class SalesforceConnector(LoadConnector, PollConnector, SlimConnector):
|
|||||||
time_filter_query = _build_time_filter_for_salesforce(start, end)
|
time_filter_query = _build_time_filter_for_salesforce(start, end)
|
||||||
|
|
||||||
for parent_object_type in self.parent_object_list:
|
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)
|
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)
|
id_batches = batch_list(all_ids, _MAX_ID_BATCH_SIZE)
|
||||||
|
|
||||||
# Generate all queries we'll need
|
# Generate all queries we'll need
|
||||||
queries = list(self._generate_query_per_parent_type(parent_object_type))
|
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)
|
yield from self._batch_retrieval(id_batches, queries)
|
||||||
|
|
||||||
def load_from_state(self) -> GenerateDocumentsOutput:
|
def load_from_state(self) -> GenerateDocumentsOutput:
|
||||||
|
@ -110,6 +110,7 @@ def _field_value_is_child_object(field_value: dict) -> bool:
|
|||||||
isinstance(field_value, OrderedDict)
|
isinstance(field_value, OrderedDict)
|
||||||
and "records" in field_value.keys()
|
and "records" in field_value.keys()
|
||||||
and isinstance(field_value["records"], list)
|
and isinstance(field_value["records"], list)
|
||||||
|
and len(field_value["records"]) > 0
|
||||||
and "Id" in field_value["records"][0].keys()
|
and "Id" in field_value["records"][0].keys()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user