@@ -195,6 +195,7 @@ const searchResultWithSiblings = [
195195 {
196196 entity : {
197197 urn : 'urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.raw_orders,PROD)' ,
198+ exists : true ,
198199 type : 'DATASET' ,
199200 name : 'cypress_project.jaffle_shop.raw_orders' ,
200201 origin : 'PROD' ,
@@ -328,6 +329,7 @@ const searchResultWithSiblings = [
328329 siblings : [
329330 {
330331 urn : 'urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.raw_orders,PROD)' ,
332+ exists : true ,
331333 type : 'DATASET' ,
332334 platform : {
333335 urn : 'urn:li:dataPlatform:dbt' ,
@@ -376,6 +378,7 @@ const searchResultWithSiblings = [
376378 {
377379 entity : {
378380 urn : 'urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.raw_orders,PROD)' ,
381+ exists : true ,
379382 type : 'DATASET' ,
380383 name : 'cypress_project.jaffle_shop.raw_orders' ,
381384 origin : 'PROD' ,
@@ -513,6 +516,169 @@ const searchResultWithSiblings = [
513516 } ,
514517] ;
515518
519+ const searchResultWithGhostSiblings = [
520+ {
521+ entity : {
522+ urn : 'urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.raw_orders,PROD)' ,
523+ exists : true ,
524+ type : 'DATASET' ,
525+ name : 'cypress_project.jaffle_shop.raw_orders' ,
526+ origin : 'PROD' ,
527+ uri : null ,
528+ platform : {
529+ urn : 'urn:li:dataPlatform:bigquery' ,
530+ type : 'DATA_PLATFORM' ,
531+ name : 'bigquery' ,
532+ properties : {
533+ type : 'RELATIONAL_DB' ,
534+ displayName : 'BigQuery' ,
535+ datasetNameDelimiter : '.' ,
536+ logoUrl : '/assets/platforms/bigquerylogo.png' ,
537+ __typename : 'DataPlatformProperties' ,
538+ } ,
539+ displayName : null ,
540+ info : null ,
541+ __typename : 'DataPlatform' ,
542+ } ,
543+ dataPlatformInstance : null ,
544+ editableProperties : null ,
545+ platformNativeType : null ,
546+ properties : {
547+ name : 'raw_orders' ,
548+ description : null ,
549+ qualifiedName : null ,
550+ customProperties : [ ] ,
551+ __typename : 'DatasetProperties' ,
552+ } ,
553+ ownership : null ,
554+ globalTags : null ,
555+ glossaryTerms : null ,
556+ subTypes : {
557+ typeNames : [ 'table' ] ,
558+ __typename : 'SubTypes' ,
559+ } ,
560+ domain : null ,
561+ container : {
562+ urn : 'urn:li:container:348c96555971d3f5c1ffd7dd2e7446cb' ,
563+ platform : {
564+ urn : 'urn:li:dataPlatform:bigquery' ,
565+ type : 'DATA_PLATFORM' ,
566+ name : 'bigquery' ,
567+ properties : {
568+ type : 'RELATIONAL_DB' ,
569+ displayName : 'BigQuery' ,
570+ datasetNameDelimiter : '.' ,
571+ logoUrl : '/assets/platforms/bigquerylogo.png' ,
572+ __typename : 'DataPlatformProperties' ,
573+ } ,
574+ displayName : null ,
575+ info : null ,
576+ __typename : 'DataPlatform' ,
577+ } ,
578+ properties : {
579+ name : 'jaffle_shop' ,
580+ __typename : 'ContainerProperties' ,
581+ } ,
582+ subTypes : {
583+ typeNames : [ 'Dataset' ] ,
584+ __typename : 'SubTypes' ,
585+ } ,
586+ deprecation : null ,
587+ __typename : 'Container' ,
588+ } ,
589+ parentContainers : {
590+ count : 2 ,
591+ containers : [
592+ {
593+ urn : 'urn:li:container:348c96555971d3f5c1ffd7dd2e7446cb' ,
594+ platform : {
595+ urn : 'urn:li:dataPlatform:bigquery' ,
596+ type : 'DATA_PLATFORM' ,
597+ name : 'bigquery' ,
598+ properties : {
599+ type : 'RELATIONAL_DB' ,
600+ displayName : 'BigQuery' ,
601+ datasetNameDelimiter : '.' ,
602+ logoUrl : '/assets/platforms/bigquerylogo.png' ,
603+ __typename : 'DataPlatformProperties' ,
604+ } ,
605+ displayName : null ,
606+ info : null ,
607+ __typename : 'DataPlatform' ,
608+ } ,
609+ properties : {
610+ name : 'jaffle_shop' ,
611+ __typename : 'ContainerProperties' ,
612+ } ,
613+ subTypes : {
614+ typeNames : [ 'Dataset' ] ,
615+ __typename : 'SubTypes' ,
616+ } ,
617+ deprecation : null ,
618+ __typename : 'Container' ,
619+ } ,
620+ {
621+ urn : 'urn:li:container:b5e95fce839e7d78151ed7e0a7420d84' ,
622+ platform : {
623+ urn : 'urn:li:dataPlatform:bigquery' ,
624+ type : 'DATA_PLATFORM' ,
625+ name : 'bigquery' ,
626+ properties : {
627+ type : 'RELATIONAL_DB' ,
628+ displayName : 'BigQuery' ,
629+ datasetNameDelimiter : '.' ,
630+ logoUrl : '/assets/platforms/bigquerylogo.png' ,
631+ __typename : 'DataPlatformProperties' ,
632+ } ,
633+ displayName : null ,
634+ info : null ,
635+ __typename : 'DataPlatform' ,
636+ } ,
637+ properties : {
638+ name : 'cypress_project' ,
639+ __typename : 'ContainerProperties' ,
640+ } ,
641+ subTypes : {
642+ typeNames : [ 'Project' ] ,
643+ __typename : 'SubTypes' ,
644+ } ,
645+ deprecation : null ,
646+ __typename : 'Container' ,
647+ } ,
648+ ] ,
649+ __typename : 'ParentContainersResult' ,
650+ } ,
651+ deprecation : null ,
652+ siblings : {
653+ isPrimary : false ,
654+ siblings : [
655+ {
656+ urn : 'urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.raw_orders,PROD)' ,
657+ exists : false ,
658+ type : 'DATASET' ,
659+ } ,
660+ ] ,
661+ __typename : 'SiblingProperties' ,
662+ } ,
663+ __typename : 'Dataset' ,
664+ } ,
665+ matchedFields : [
666+ {
667+ name : 'name' ,
668+ value : 'raw_orders' ,
669+ __typename : 'MatchedField' ,
670+ } ,
671+ {
672+ name : 'id' ,
673+ value : 'cypress_project.jaffle_shop.raw_orders' ,
674+ __typename : 'MatchedField' ,
675+ } ,
676+ ] ,
677+ insights : [ ] ,
678+ __typename : 'SearchResult' ,
679+ } ,
680+ ] ;
681+
516682describe ( 'siblingUtils' , ( ) => {
517683 describe ( 'combineEntityDataWithSiblings' , ( ) => {
518684 it ( 'combines my metadata with my siblings as primary' , ( ) => {
@@ -564,6 +730,18 @@ describe('siblingUtils', () => {
564730 expect ( result ?. [ 0 ] ?. matchedEntities ?. [ 1 ] ?. urn ) . toEqual (
565731 'urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.raw_orders,PROD)' ,
566732 ) ;
733+
734+ expect ( result ?. [ 0 ] ?. matchedEntities ) . toHaveLength ( 2 ) ;
735+ } ) ;
736+
737+ it ( 'will not combine an entity with a ghost node' , ( ) => {
738+ const result = combineSiblingsInSearchResults ( searchResultWithGhostSiblings as any ) ;
739+
740+ expect ( result ) . toHaveLength ( 1 ) ;
741+ expect ( result ?. [ 0 ] ?. matchedEntities ?. [ 0 ] ?. urn ) . toEqual (
742+ 'urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.raw_orders,PROD)' ,
743+ ) ;
744+ expect ( result ?. [ 0 ] ?. matchedEntities ) . toHaveLength ( 1 ) ;
567745 } ) ;
568746 } ) ;
569747
0 commit comments