mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-30 18:17:53 +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]] |         self, original: List[Dict[str, Any]], updated: List[Dict[str, Any]] | ||||||
|     ): |     ): | ||||||
|         temp_result = [] |         temp_result = [] | ||||||
|         for column in original or []: |         try: | ||||||
|             temp_result.append((*column.get("fromColumns", []), column.get("toColumn"))) |             for column in original or []: | ||||||
|         for column in updated or []: |                 if column.get("toColumn") and column.get("fromColumns"): | ||||||
|             data = column.dict() |                     temp_result.append( | ||||||
|             temp_result.append((*data.get("fromColumns", []), data.get("toColumn"))) |                         (*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 [ |         return [ | ||||||
|             {"fromColumns": list(col_data[:-1]), "toColumn": col_data[-1]} |             {"fromColumns": list(col_data[:-1]), "toColumn": col_data[-1]} | ||||||
|             for col_data in set(temp_result) |             for col_data in set(temp_result) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Mayur Singal
						Mayur Singal