Skip to content

Commit

Permalink
Merge pull request #7 from LCOGT/fix/operation_incorrect_args
Browse files Browse the repository at this point in the history
Fixed bug for long and no-op not running
  • Loading branch information
LTDakin authored Apr 17, 2024
2 parents 883f3ea + ab954e2 commit c273610
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion datalab/datalab_session/data_operations/data_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion datalab/datalab_session/data_operations/long.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', [])):
Expand Down
2 changes: 1 addition & 1 deletion datalab/datalab_session/data_operations/median.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion datalab/datalab_session/data_operations/noop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', [])
Expand Down
2 changes: 1 addition & 1 deletion datalab/datalab_session/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', []))

0 comments on commit c273610

Please sign in to comment.