mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-27 01:45:32 +00:00
parent
06d9329ae3
commit
15d0440599
@ -13,6 +13,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import ssl
|
import ssl
|
||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
@ -205,6 +206,7 @@ class ElasticsearchSink(Sink[Entity]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def write_record(self, record: Entity) -> None:
|
def write_record(self, record: Entity) -> None:
|
||||||
|
try:
|
||||||
if isinstance(record, Table):
|
if isinstance(record, Table):
|
||||||
table_doc = self._create_table_es_doc(record)
|
table_doc = self._create_table_es_doc(record)
|
||||||
self.elasticsearch_client.index(
|
self.elasticsearch_client.index(
|
||||||
@ -270,6 +272,9 @@ class ElasticsearchSink(Sink[Entity]):
|
|||||||
self.status.records_written(record.name.__root__)
|
self.status.records_written(record.name.__root__)
|
||||||
else:
|
else:
|
||||||
self.status.records_written(record.name)
|
self.status.records_written(record.name)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Failed to index entity {record} due to {e}")
|
||||||
|
logger.debug(traceback.print_exc())
|
||||||
|
|
||||||
def _create_table_es_doc(self, table: Table):
|
def _create_table_es_doc(self, table: Table):
|
||||||
fqdn = table.fullyQualifiedName
|
fqdn = table.fullyQualifiedName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user