From ab954e2a8b827f7487f225d6b17562fdebc63ab3 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Wed, 17 Apr 2024 14:49:12 -0700 Subject: [PATCH] added args to no-op and long to include cache_key and input_files since they were causing errors --- datalab/datalab_session/data_operations/data_operation.py | 2 +- datalab/datalab_session/data_operations/long.py | 2 +- datalab/datalab_session/data_operations/median.py | 2 +- datalab/datalab_session/data_operations/noop.py | 2 +- datalab/datalab_session/tasks.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datalab/datalab_session/data_operations/data_operation.py b/datalab/datalab_session/data_operations/data_operation.py index a9aa37a..042535b 100644 --- a/datalab/datalab_session/data_operations/data_operation.py +++ b/datalab/datalab_session/data_operations/data_operation.py @@ -50,7 +50,7 @@ def wizard_description(): """ @abstractmethod - def operate(self): + def operate(self, cache_key, input_files): """ The method that performs the data operation. It should periodically update the percent completion during its operation. It should set the output and status into the cache when done. diff --git a/datalab/datalab_session/data_operations/long.py b/datalab/datalab_session/data_operations/long.py index 7f8d77c..184e769 100644 --- a/datalab/datalab_session/data_operations/long.py +++ b/datalab/datalab_session/data_operations/long.py @@ -36,7 +36,7 @@ def wizard_description(): } } - def operate(self): + def operate(self, cache_key, input_files): num_files = len(self.input_data.get('input_files', [])) per_image_timeout = ceil(float(self.input_data.get('duration', 60.0)) / num_files) for i, file in enumerate(self.input_data.get('input_files', [])): diff --git a/datalab/datalab_session/data_operations/median.py b/datalab/datalab_session/data_operations/median.py index e67e286..82b494c 100644 --- a/datalab/datalab_session/data_operations/median.py +++ b/datalab/datalab_session/data_operations/median.py @@ -38,7 +38,7 @@ def wizard_description(): } } - def operate(self, input_files, cache_key): + def operate(self, cache_key, input_files): log.info(f'Executing median operation on {len(input_files)} files') diff --git a/datalab/datalab_session/data_operations/noop.py b/datalab/datalab_session/data_operations/noop.py index 9905ef4..172a2f5 100644 --- a/datalab/datalab_session/data_operations/noop.py +++ b/datalab/datalab_session/data_operations/noop.py @@ -40,7 +40,7 @@ def wizard_description(): } } - def operate(self): + def operate(self, cache_key, input_files): print("No-op triggered!") output = { 'output_files': self.input_data.get('input_files', []) diff --git a/datalab/datalab_session/tasks.py b/datalab/datalab_session/tasks.py index 4000dae..0b8b7f3 100644 --- a/datalab/datalab_session/tasks.py +++ b/datalab/datalab_session/tasks.py @@ -19,4 +19,4 @@ def execute_data_operation(data_operation_name: str, input_data: dict): operation = operation_class(input_data) cache_key = operation.generate_cache_key() - operation.operate(input_data.get('input_files', []), cache_key) + operation.operate(cache_key, input_data.get('input_files', []))