Fixes #18186: Quicksight Ingestion Error handled (#18218)

This commit is contained in:
Ayush Shah 2024-10-16 09:52:07 +05:30 committed by GitHub
parent 831cccf71e
commit 40bd3bd3fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 61 additions and 52 deletions

View File

@ -247,6 +247,7 @@ class QuicksightSource(DashboardServiceSource):
**data_source["RelationalTable"]
)
except (KeyError, ValidationError) as err:
data_source_resp = None
yield Either(
left=StackTraceError(
name="Lineage",
@ -257,7 +258,7 @@ class QuicksightSource(DashboardServiceSource):
stackTrace=traceback.format_exc(),
)
)
if data_source_resp:
schema_name = data_source_resp.schema_name
table_name = data_source_resp.table_name
@ -283,14 +284,19 @@ class QuicksightSource(DashboardServiceSource):
DataSourceId=data_source_id,
)
).DataSource
if data_source_resp and data_source_resp.DataSourceParameters:
if (
data_source_resp
and data_source_resp.DataSourceParameters
):
data_source_dict = data_source_resp.DataSourceParameters
for db in data_source_dict.keys() or []:
from_fqn = fqn.build(
self.metadata,
entity_type=Table,
service_name=db_service_name,
database_name=data_source_dict[db].get("Database"),
database_name=data_source_dict[db].get(
"Database"
),
schema_name=schema_name,
table_name=table_name,
skip_es_search=True,
@ -309,7 +315,10 @@ class QuicksightSource(DashboardServiceSource):
entity=Dashboard,
fqn=to_fqn,
)
if from_entity is not None and to_entity is not None:
if (
from_entity is not None
and to_entity is not None
):
yield self._get_add_lineage_request(
to_entity=to_entity, from_entity=from_entity
)

View File

@ -50,12 +50,12 @@ class DashboardResp(BaseModel):
RequestId: Optional[str] = None
class DataSource(BaseModel):
class DataSourceModel(BaseModel):
DataSourceId: str
DataSourceParameters: Optional[dict] = None
class DescribeDataSourceResponse(BaseModel):
DataSource: Optional[DataSource] = None
DataSource: Optional[DataSourceModel] = None
RequestId: Optional[str] = None
Status: Optional[int] = None