diff --git a/ingestion/src/metadata/data_insight/api/workflow.py b/ingestion/src/metadata/data_insight/api/workflow.py index 8d427d8fb426..ca0a6e101466 100644 --- a/ingestion/src/metadata/data_insight/api/workflow.py +++ b/ingestion/src/metadata/data_insight/api/workflow.py @@ -192,6 +192,7 @@ def _check_and_handle_existing_es_data(self, index: str) -> None: def _execute_data_processor(self): """Data processor method to refine raw data into report data and ingest it in ES""" for report_data_type in ReportDataType: + has_checked_and_handled_existing_es_data = False logger.info(f"Processing data for report type {report_data_type}") try: self.data_processor = DataProcessor.create( @@ -201,9 +202,11 @@ def _execute_data_processor(self): if hasattr(self, "sink"): self.sink.write_record(record) if hasattr(self, "es_sink"): - self._check_and_handle_existing_es_data( - DataInsightEsIndex[record.data.__class__.__name__].value - ) + if not has_checked_and_handled_existing_es_data: + self._check_and_handle_existing_es_data( + DataInsightEsIndex[record.data.__class__.__name__].value + ) + has_checked_and_handled_existing_es_data = True self.es_sink.write_record(record) else: logger.warning(