mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 04:14:34 +00:00
MINOR: Fix data insights misbehaving due to validation error (#16251)
* Add a Try/Except block to allow the ingestion to continue if ValidationError occurs * Fix checkstyle * Fix linter
This commit is contained in:
parent
bb6c0b1096
commit
d91ec3d6a0
@ -19,6 +19,8 @@ import re
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from typing import Generator, Iterable, Optional
|
from typing import Generator, Iterable, Optional
|
||||||
|
|
||||||
|
from pydantic import ValidationError
|
||||||
|
|
||||||
from metadata.data_insight.processor.reports.data_processor import DataProcessor
|
from metadata.data_insight.processor.reports.data_processor import DataProcessor
|
||||||
from metadata.generated.schema.analytics.reportData import ReportData, ReportDataType
|
from metadata.generated.schema.analytics.reportData import ReportData, ReportDataType
|
||||||
from metadata.generated.schema.analytics.reportDataType.webAnalyticEntityViewReportData import (
|
from metadata.generated.schema.analytics.reportDataType.webAnalyticEntityViewReportData import (
|
||||||
@ -123,11 +125,16 @@ class WebAnalyticEntityViewReportDataProcessor(DataProcessor):
|
|||||||
logger.debug(f"Could not find entity Href for {entity_obj.fqn}")
|
logger.debug(f"Could not find entity Href for {entity_obj.fqn}")
|
||||||
|
|
||||||
if entity_obj.fqn not in refined_data:
|
if entity_obj.fqn not in refined_data:
|
||||||
entity = self.metadata.get_by_name(
|
try:
|
||||||
ENTITIES[entity_obj.entity_type],
|
entity = self.metadata.get_by_name(
|
||||||
fqn=entity_obj.fqn,
|
ENTITIES[entity_obj.entity_type],
|
||||||
fields=["*"],
|
fqn=entity_obj.fqn,
|
||||||
)
|
fields=["*"],
|
||||||
|
)
|
||||||
|
except ValidationError as exc:
|
||||||
|
entity = None
|
||||||
|
logger.warning("%s Entity failed to be parsed", entity_obj.fqn)
|
||||||
|
logger.debug(exc)
|
||||||
|
|
||||||
if not entity:
|
if not entity:
|
||||||
# If a user visits an entity and then deletes this entity, we will try to get the entity
|
# If a user visits an entity and then deletes this entity, we will try to get the entity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user