mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-06 15:43:04 +00:00
MINOR: Fix column merge error lineage (#16670)
* MINOR: Fix Column merge error * append only when col lineage available * pyformat
This commit is contained in:
parent
60208a1990
commit
72ed09d6f6
@ -52,11 +52,24 @@ class OMetaLineageMixin(Generic[T]):
|
||||
self, original: List[Dict[str, Any]], updated: List[Dict[str, Any]]
|
||||
):
|
||||
temp_result = []
|
||||
for column in original or []:
|
||||
temp_result.append((*column.get("fromColumns", []), column.get("toColumn")))
|
||||
for column in updated or []:
|
||||
data = column.dict()
|
||||
temp_result.append((*data.get("fromColumns", []), data.get("toColumn")))
|
||||
try:
|
||||
for column in original or []:
|
||||
if column.get("toColumn") and column.get("fromColumns"):
|
||||
temp_result.append(
|
||||
(*column.get("fromColumns", []), column.get("toColumn"))
|
||||
)
|
||||
for column in updated or []:
|
||||
if not isinstance(column, dict):
|
||||
data = column.dict()
|
||||
else:
|
||||
data = column
|
||||
if data.get("toColumn") and data.get("fromColumns"):
|
||||
temp_result.append(
|
||||
(*data.get("fromColumns", []), data.get("toColumn"))
|
||||
)
|
||||
except Exception as exc:
|
||||
logger.debug(f"Error while merging column lineage: {exc}")
|
||||
logger.debug(traceback.format_exc())
|
||||
return [
|
||||
{"fromColumns": list(col_data[:-1]), "toColumn": col_data[-1]}
|
||||
for col_data in set(temp_result)
|
||||
|
Loading…
x
Reference in New Issue
Block a user