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

Class CombineFirst

dask/dataframe/dask_expr/_expr.py:1254–1281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

combine_firstMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected