File tree Expand file tree Collapse file tree
react/src/components/graph Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * Nominal type
3+ *
4+ * This is a nominal type that is used to create a new type that is a brand of the original type.
5+ * This is useful for creating interfaces that are not compatible with the original type and require
6+ * a type check to ensure that the type is correct.
7+ */
8+ export type Nominal < K , T > = K & { __brand : T }
Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ function ModelColumn({
402402 refetch : getColumnLineage ,
403403 isFetching,
404404 isError,
405- } = useApiColumnLineage ( nodeId , column . name )
405+ } = useApiColumnLineage ( nodeId , column . name , { models_only : true } )
406406
407407 useEffect ( ( ) => {
408408 if ( isNil ( selectManually ) ) return
Original file line number Diff line number Diff line change @@ -53,11 +53,10 @@ export default function ModelNode({
5353 const modelsArray = Object . values ( models )
5454 const decodedId = decodeURIComponent ( id )
5555 const model = modelsArray . find ( ( m : Model ) => m . fqn === decodedId )
56- if ( ! model ) {
57- throw new Error ( `Model not found: ${ id } ` )
58- }
5956 const modelColumns = model ?. columns ?? [ ]
6057
58+ console . log ( 'lineage' , lineage )
59+
6160 Object . keys ( lineage [ decodedId ] ?. columns ?? { } ) . forEach ( ( column : string ) => {
6261 const found = modelColumns . find ( ( { name } : any ) => {
6362 try {
@@ -158,6 +157,20 @@ export default function ModelNode({
158157 // isFalse(isModelUnknown)
159158 const shouldDisableColumns = isFalse ( isModelSQL )
160159
160+ const nodeLabel : string = nodeData . label . includes ( ':' )
161+ ? ( nodeData . label . split ( ':' ) . pop ( ) ?? nodeData . label )
162+ : nodeData . label
163+ console . log (
164+ 'id' ,
165+ id ,
166+ isCTE ,
167+ columns ,
168+ nodeData . label ,
169+ 'does node label include :' ,
170+ nodeData . label . includes ( ':' ) ,
171+ nodeLabel ,
172+ )
173+
161174 return (
162175 < div
163176 onMouseEnter = { ( ) => setIsMouseOver ( true ) }
@@ -200,7 +213,7 @@ export default function ModelNode({
200213 < ModelNodeHeaderHandles
201214 id = { id }
202215 type = { nodeType }
203- label = { nodeData . label }
216+ label = { nodeLabel }
204217 isSelected = { isSelected }
205218 isDraggable = { true }
206219 className = { clsx (
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import logging
34import typing as t
45from collections import defaultdict
56
1920
2021router = APIRouter ()
2122
23+ logger = logging .getLogger (__name__ )
24+
2225
2326def quote_column (column : str , dialect : str ) -> str :
2427 return exp .to_identifier (column , quoted = True ).sql (dialect = dialect )
@@ -134,6 +137,9 @@ def column_lineage(
134137) -> t .Dict [str , t .Dict [str , LineageColumn ]]:
135138 """Get a column's lineage"""
136139 try :
140+ logger .info (
141+ f"Getting column lineage for { model_name } .{ column_name } , models only: { models_only } "
142+ )
137143 model_name = context .get_model (model_name ).fqn
138144 if models_only :
139145 return create_models_only_lineage_adjacency_list (model_name , column_name , context )
You can’t perform that action at this time.
0 commit comments