77 isObjectEmpty ,
88 toID ,
99} from '@/utils/index'
10- import { type LineageColumn , type Column } from '@/api/client'
10+ import { type LineageColumn , type Column , type Model } from '@/api/client'
1111import { Position , type Edge , type Node , type XYPosition } from 'reactflow'
1212import { type ActiveEdges , type Connections } from './context'
1313import { EnumSide } from './types'
@@ -17,7 +17,6 @@ import {
1717} from './ModelNode'
1818import type { Lineage } from '@/domain/lineage'
1919import type { ConnectedNode } from '@/workers/lineage'
20- import type { ModelSQLMeshModel } from '@/domain/sqlmesh-model'
2120
2221export interface GraphNodeData {
2322 label : string
@@ -102,7 +101,6 @@ function getEdges(lineage: Record<string, Lineage> = {}): Edge[] {
102101 for ( const targetModelName of modelNames ) {
103102 const targetModel = lineage [ targetModelName ] !
104103
105- // @ts -ignore
106104 targetModel . models . forEach ( sourceModelName => {
107105 outputEdges . push ( createGraphEdge ( sourceModelName , targetModelName ) )
108106 } )
@@ -156,7 +154,7 @@ function getNodeMap({
156154 unknownModels,
157155 withColumns,
158156} : {
159- models : Map < string , ModelSQLMeshModel >
157+ models : Record < string , Model >
160158 withColumns : boolean
161159 unknownModels : Set < string >
162160 lineage ?: Record < string , Lineage >
@@ -172,9 +170,9 @@ function getNodeMap({
172170 const modelNames = Object . keys ( lineage )
173171
174172 return modelNames . reduce ( ( acc : Record < string , Node > , modelName : string ) => {
175- // @ts -ignore
176173 const model = models [ modelName ]
177174 const node = createGraphNode ( modelName , {
175+ // @ts -ignore
178176 label : model ?. displayName ?? modelName ,
179177 withColumns,
180178 type : isNotNil ( model )
@@ -188,8 +186,7 @@ function getNodeMap({
188186 : EnumLineageNodeModelType . cte ,
189187 } )
190188 const columnsCount = withColumns
191- ? // @ts -ignore
192- ( models [ modelName ] ?. columns ?. length ?? 0 )
189+ ? ( models [ modelName ] ?. columns ?. length ?? 0 )
193190 : 0
194191
195192 const maxWidth = Math . min (
@@ -218,7 +215,6 @@ function getNodeMap({
218215
219216 function getNodeMaxWidth ( label : string , hasColumns : boolean = false ) : number {
220217 const defaultWidth = label . length * CHAR_WIDTH
221- // @ts -ignore
222218 const columns = models [ label ] ?. columns ?? [ ]
223219
224220 return hasColumns
@@ -369,7 +365,6 @@ function mergeLineageWithColumns(
369365 newLineageModelColumnModel ,
370366 ) ,
371367 ) ,
372- // @ts -ignore
373368 ) . map ( encodeURI )
374369 }
375370 }
@@ -476,7 +471,6 @@ function getLineageIndex(lineage: Record<string, Lineage> = {}): string {
476471 const { models = [ ] , columns = { } } = lineage [ key ] !
477472 const allModels = new Set < string > ( )
478473
479- // @ts -ignore
480474 models . forEach ( m => allModels . add ( m ) )
481475
482476 if ( isNotNil ( columns ) ) {
0 commit comments