Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def add_to_apply_calls(self, func, **kwargs):
return PandasOnPythonFramePartition(
self.data.copy(), call_queue=self.call_queue + [(func, kwargs)]
)
applied to it.
"""
def call_queue_closure(data, call_queues):
result = data.copy()
for func, kwargs in call_queues:
try:
result = func(result, **kwargs)
except Exception as e:
self.call_queue = []
raise e
return result
self.data = call_queue_closure(self.data, self.call_queue)
self.call_queue = []
return PandasOnPythonFramePartition(func(self.data.copy(), **kwargs))