Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 28, 2024
1 parent 4acdca1 commit a36c296
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion rechunker/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ class PythonCopySpecExecutor(PythonPipelineExecutor, CopySpecToPipelinesMixin):
elif name.lower() == "lithops":
from rechunker.executors.lithops import LithopsPipelineExecutor

class LithopsCopySpecExecutor(LithopsPipelineExecutor, CopySpecToPipelinesMixin):
class LithopsCopySpecExecutor(
LithopsPipelineExecutor, CopySpecToPipelinesMixin
):
pass

return LithopsCopySpecExecutor()
Expand Down
8 changes: 4 additions & 4 deletions rechunker/executors/lithops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

Task = Callable[[], None]


class LithopsPipelineExecutor(PipelineExecutor[Task]):
"""An execution engine based on Lithops framework."""

Expand All @@ -24,19 +25,18 @@ def _prepare_input_data():
iterdata.append((None, stage.function, pipeline.config))
return iterdata

def plan(config):
def plan(config):
iterdata = _prepare_input_data()

if config is None:
fexec = lithops.FunctionExecutor(config=config)
else:
fexec = lithops.FunctionExecutor()

fexec.map(map_function, iterdata[0])
fexec.get_result()

return plan

def execute_plan(self, plan: Task, config = None, **kwargs):
def execute_plan(self, plan: Task, config=None, **kwargs):
plan(config)

0 comments on commit a36c296

Please sign in to comment.