MCPcopy Create free account
hub / github.com/dask/dask / CombineFirst

Class CombineFirst

dask/dataframe/dask_expr/_expr.py:1250–1277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1248
1249
1250class CombineFirst(Blockwise):
1251 _parameters = ["frame", "other"]
1252 operation = M.combine_first
1253
1254 @functools.cached_property
1255 def _meta(self):
1256 return make_meta(
1257 self.operation(
1258 meta_nonempty(self.frame._meta),
1259 meta_nonempty(self.other._meta),
1260 ),
1261 )
1262
1263 def _simplify_up(self, parent, dependents):
1264 if isinstance(parent, Projection):
1265 columns = determine_column_projection(self, parent, dependents)
1266 frame_columns = [col for col in self.frame.columns if col in columns]
1267 other_columns = [col for col in self.other.columns if col in columns]
1268 if (
1269 self.frame.columns == frame_columns
1270 and self.other.columns == other_columns
1271 ):
1272 return
1273
1274 return type(parent)(
1275 type(self)(self.frame[frame_columns], self.other[other_columns]),
1276 *parent.operands[1:],
1277 )
1278
1279
1280class Sample(Blockwise):

Callers 1

combine_firstMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected