Skip to content

Commit

Permalink
Ignore converted datasets in invalid input states
Browse files Browse the repository at this point in the history
Fixes a bug reported by @jennaj where using an input dataset from a history
import (which contains implicitly converted datasets in discarded state)
in an input that would require that exact same implicit conversion
would fail with `Job output deleted by user before job completed`.

This will make the whole implicit coversion system much more robust,
since we didn't even exclude datasets in error state, so as soon as one
conversion failed ... you'd be stuck.
  • Loading branch information
mvdbeek committed Sep 19, 2024
1 parent b1b9051 commit 0c746fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3945,7 +3945,9 @@ class Dataset(Base, StorableObject, Serializable):

non_ready_states = (states.NEW, states.UPLOAD, states.QUEUED, states.RUNNING, states.SETTING_METADATA)
ready_states = tuple(set(states.__members__.values()) - set(non_ready_states))
valid_input_states = tuple(set(states.__members__.values()) - {states.ERROR, states.DISCARDED})
valid_input_states = tuple(
set(states.__members__.values()) - {states.ERROR, states.DISCARDED, states.FAILED_METADATA}
)
no_data_states = (states.PAUSED, states.DEFERRED, states.DISCARDED, *non_ready_states)
terminal_states = (
states.OK,
Expand Down Expand Up @@ -4691,7 +4693,7 @@ def display_info(self):

def get_converted_files_by_type(self, file_type):
for assoc in self.implicitly_converted_datasets:
if not assoc.deleted and assoc.type == file_type:
if not assoc.deleted and assoc.type == file_type and assoc.state in Dataset.valid_input_states:
if assoc.dataset:
return assoc.dataset
return assoc.dataset_ldda
Expand Down

0 comments on commit 0c746fb

Please sign in to comment.