@@ -123,16 +123,18 @@ def _domain_is_empty(domain: Optional[DomainT]) -> bool:
123123 return domain is None or len (domain ) == 0
124124
125125 def _domain_diff (candidates : Optional [DomainT ], visited : Optional [DomainT ]) -> Optional [DomainT ]:
126- if _domain_is_empty (candidates ) or _domain_is_empty (visited ):
126+ if candidates is None or visited is None :
127+ return candidates
128+ if len (candidates ) == 0 or len (visited ) == 0 :
127129 return candidates
128130 return candidates [~ candidates .isin (visited )]
129131
130132 def _domain_union (left : Optional [DomainT ], right : Optional [DomainT ]) -> Optional [DomainT ]:
131- if _domain_is_empty (left ):
133+ if left is None or len (left ) == 0 :
132134 return right
133- if _domain_is_empty (right ):
135+ if right is None or len (right ) == 0 :
134136 return left
135- if engine_concrete == Engine .PANDAS and isinstance (left , pd .Index ):
137+ if engine_concrete == Engine .PANDAS and isinstance (left , pd .Index ) and isinstance ( right , pd . Index ) :
136138 return left .append (right )
137139 return concat ([left , right ], ignore_index = True )
138140
@@ -297,9 +299,10 @@ def resolve_label_col(requested: Optional[str], df, default_base: str) -> Option
297299 base_target_nodes = g2 ._nodes
298300 else :
299301 base_target_nodes = concat ([target_wave_front , g2 ._nodes ], ignore_index = True , sort = False ).drop_duplicates (subset = [node_col ])
300- def _build_allowed_ids (
301- base_nodes : DataFrameT ,
302- match_dict : Optional [dict ],
302+
303+ def _build_allowed_ids (
304+ base_nodes : DataFrameT ,
305+ match_dict : Optional [dict ],
303306 match_query : Optional [str ],
304307 ) -> Optional [DataFrameT ]:
305308 if match_dict is None and match_query is None :
0 commit comments