Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""Apply some callable function to the data in this partition.
Note: It is up to the implementation how kwargs are handled. They are
an important part of many implementations. As of right now, they
are not serialized.
Args:
func: The lambda to apply (may already be correctly formatted)
Returns:
A new `BaseFramePartition` containing the object that has had `func`
applied to it.
"""
call_queue = self.call_queue + [[func, kwargs]]
future = self.client.submit(apply_list_of_funcs, call_queue, self.future)
return PandasOnDaskFramePartition(future)
def add_to_apply_calls(self, func, **kwargs):
return PandasOnDaskFramePartition(
self.future, call_queue=self.call_queue + [[func, kwargs]]
)
def __copy__(self):
return PandasOnDaskFramePartition(
self.future, self._length_cache, self._width_cache
)