Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e7422b0
added necessary changes to accomodate tempLineageTables nodes
Apr 24, 2026
7a9247d
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 24, 2026
db469d1
updated code as per comments from Gitar
Apr 24, 2026
23a11d7
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 24, 2026
7c7d3d8
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 26, 2026
bc42127
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
cf6f830
fixed lint issues
Apr 27, 2026
11e7ce5
worked up the comments from Chirag
Apr 27, 2026
47f09ab
worked up linting issues
Apr 27, 2026
9abaf1d
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
d6157d4
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
ce5e2bf
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
4ec1455
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
d4ba354
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
aa99f60
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
3bd28b6
fixed tc for nodeHeight
Apr 27, 2026
53f77b8
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
0b3f388
updated args for getEntityLineageCords
Apr 27, 2026
bccf3c1
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 27, 2026
c947c8d
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 28, 2026
7593646
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 28, 2026
6f8d421
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 28, 2026
0c327b3
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 28, 2026
792513f
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 28, 2026
6fd56be
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 28, 2026
952a590
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 29, 2026
0b4d555
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 29, 2026
fa92368
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 29, 2026
54eaf02
Merge branch 'main' into feat/temp_lineage_table
satender-kumar-collate Apr 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ const EntityLabel = ({ node }: Pick<LineageNodeLabelProps, 'node'>) => {
childrenCount > 0 ? 'with-footer' : ''
)}>
<Col className="d-flex items-center" flex="auto">
<div className="d-flex entity-service-icon m-r-xs">
{getServiceIcon(node)}
</div>
{!node.isTempTable && (
<div className="d-flex entity-service-icon m-r-xs">
{getServiceIcon(node)}
</div>
)}
<Space align="start" className="flex-1" direction="vertical" size={0}>
<Typography.Text
className="m-b-0 d-block text-left entity-header-display-name text-md font-medium w-54"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import { MessageSchemaObject } from '../../generated/entity/data/topic';
import { EntityReference } from '../../generated/entity/type';
import { TagLabel } from '../../generated/tests/testCase';
import { APISchema } from '../../generated/type/apiSchema';
import { ColumnLineage } from '../../generated/type/entityLineage';
import {
ColumnLineage,
TempLineageTable,
} from '../../generated/type/entityLineage';
import {
SearchSourceAlias,
TableSearchSource,
Expand Down Expand Up @@ -65,6 +68,7 @@ export interface EdgeDetails {
pipelineEntityType?: EntityType.PIPELINE | EntityType.STORED_PROCEDURE;
docId?: string;
extraInfo?: EdgeDetails;
tempLineageTables?: TempLineageTable[];
}

export interface ColumnLevelLineageNode
Expand Down Expand Up @@ -168,4 +172,5 @@ export interface LineageNodeType
responseSchema?: APISchema;
requestSchema?: APISchema;
fields?: SearchIndexField[];
isTempTable?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,10 @@ const LineageProvider = ({ children }: LineageProviderProps) => {
return;
}

if (node.data?.node?.isTempTable) {
return;
}

if (node.type === EntityLineageNodeType.LOAD_MORE) {
selectLoadMoreNode(node);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* limitations under the License.
*/
import { Edge, Node, Viewport } from 'reactflow';
import { EntityType } from '../enums/entity.enum';
import {
BoundingBox,
boundsIntersect,
Expand Down Expand Up @@ -218,11 +219,12 @@ describe('CanvasUtils', () => {

const result = getEdgeCoordinates(edge, sourceNode, targetNode);

// Y uses node.height (100) from createMockNode, so midpoint = 50
expect(result).toEqual({
sourceX: 400,
sourceY: 33,
sourceY: 50,
targetX: 490,
targetY: 33,
targetY: 50,
});
});

Expand All @@ -237,9 +239,9 @@ describe('CanvasUtils', () => {

expect(result).not.toBeNull();
expect(result?.sourceX).toBe(500);
expect(result?.sourceY).toBe(233);
expect(result?.sourceY).toBe(250); // 200 + 100/2
expect(result?.targetX).toBe(590);
expect(result?.targetY).toBe(333);
expect(result?.targetY).toBe(350); // 300 + 100/2
});
});

Expand Down Expand Up @@ -391,6 +393,54 @@ describe('CanvasUtils', () => {
expect(result?.targetX).toBe(490);
});
});

describe('temp lineage nodes', () => {
const createTempNode = (id: string, measuredHeight: number): Node => ({
id,
position: { x: 0, y: 0 },
data: {
node: {
id,
name: id,
entityType: EntityType.TABLE,
isTempTable: true,
columns: [],
},
isRootNode: false,
},
width: 400,
height: measuredHeight,
});

it('uses measured node.height for temp node entity-level edge', () => {
const edge = createMockEdge('edge1', 'temp_staging', 'node2', false);
const tempNode = createTempNode('temp_staging', 80);
const targetNode = createMockNode('node2');
targetNode.position = { x: 500, y: 0 };

const result = getEdgeCoordinates(edge, tempNode, targetNode);

expect(result).not.toBeNull();
expect(result?.sourceY).toBe(40); // 0 + 80/2 (measured height), not 33 (getNodeHeight formula)
expect(result?.targetY).toBe(50); // 0 + 100/2
});

it('centers edge at actual midpoint when measured height differs from computed height', () => {
const edge = createMockEdge('edge1', 'node1', 'node2', false);
const sourceNode = createMockNode('node1');
sourceNode.height = 150;
sourceNode.position = { x: 0, y: 100 };
const targetNode = createMockNode('node2');
targetNode.height = 200;
targetNode.position = { x: 500, y: 100 };

const result = getEdgeCoordinates(edge, sourceNode, targetNode);

expect(result).not.toBeNull();
expect(result?.sourceY).toBe(175); // 100 + 150/2
expect(result?.targetY).toBe(200); // 100 + 200/2
});
});
});

describe('getEdgeBounds', () => {
Expand All @@ -414,7 +464,8 @@ describe('CanvasUtils', () => {
expect(result).not.toBeNull();
expect(result!.minX).toBeLessThan(351);
expect(result!.maxX).toBeGreaterThan(500);
expect(result!.minY).toBeLessThan(0);
// sourceY = 50 (node.height=100 / 2), padding=50 → minY = 0
expect(result!.minY).toBeLessThanOrEqual(0);
expect(result!.maxY).toBeGreaterThan(100);
});
});
Expand Down
27 changes: 13 additions & 14 deletions openmetadata-ui/src/main/resources/ui/src/utils/CanvasUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,19 @@ const getBaseNodeHeightFromType = (
return isRootNode ? baseHeight + 10 : baseHeight;
};

const getNodeYPadding = (node: Node): number => {
const { children } = getEntityChildrenAndLabel(node.data.node);

const sourceYPadding = children.length > 0 ? 48 : 0;

return sourceYPadding;
};

export function getNodeHeight(
node: Node,
isColumnLineage: boolean,
isColumnLineage?: boolean,
columnCount?: number
) {
): number {
const isRootNode = node.data?.isRootNode ?? false;

const visibleColumnCount = isColumnLineage
Expand All @@ -124,15 +132,6 @@ export function getNodeHeight(
return height;
}

const getNodeYPadding = (node: Node): number => {
const { children } = getEntityChildrenAndLabel(node.data.node);

const sourceYPadding = children.length > 0 ? 48 : 0;

// Add padding for the node's border
return sourceYPadding;
};

interface ColumnLineageData {
columnIds: string[];
columnIndex: number;
Expand Down Expand Up @@ -252,10 +251,10 @@ function getColumnLineageCoordinates(
function getEntityLineageCoordinates(
sourceNode: Node,
targetNode: Node,
isColumnLineage: boolean
_isColumnLineage: boolean
): EdgeCoordinates {
const sourceHeight = getNodeHeight(sourceNode, isColumnLineage, 0);
const targetHeight = getNodeHeight(targetNode, isColumnLineage, 0);
const sourceHeight = sourceNode.height ?? 0;
const targetHeight = targetNode.height ?? 0;

return {
sourceX: sourceNode.position.x + (sourceNode.width ?? 0),
Expand Down
Loading
Loading