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