[hg] galaxy 2625: Allow column parameters to be late validated i...
details: http://www.bx.psu.edu/hg/galaxy/rev/50e4baed24f5 changeset: 2625:50e4baed24f5 user: James Taylor <james@jamestaylor.org> date: Tue Aug 25 16:25:50 2009 -0400 description: Allow column parameters to be late validated if the job is still running and metadata is not yet available 2 file(s) affected in this change: lib/galaxy/model/__init__.py lib/galaxy/tools/parameters/basic.py diffs (52 lines): diff -r 16fedfa03433 -r 50e4baed24f5 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py Tue Aug 25 15:15:07 2009 -0400 +++ b/lib/galaxy/model/__init__.py Tue Aug 25 16:25:50 2009 -0400 @@ -403,6 +403,7 @@ return self.get_size() > 0 def mark_deleted( self, include_children=True ): self.deleted = True + # FIXME: sqlalchemy will replace this def _delete(self): """Remove the file that corresponds to this data""" @@ -560,6 +561,14 @@ if self.purged: return False return True + @property + def is_pending( self ): + """ + Return true if the dataset is neither ready nor in error + """ + return self.state in ( self.states.NEW, self.states.UPLOAD, + self.states.QUEUED, self.states.RUNNING, + self.states.SETTING_METADATA ) @property def source_library_dataset( self ): def get_source( dataset ): diff -r 16fedfa03433 -r 50e4baed24f5 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py Tue Aug 25 15:15:07 2009 -0400 +++ b/lib/galaxy/tools/parameters/basic.py Tue Aug 25 16:25:50 2009 -0400 @@ -793,7 +793,21 @@ return set( self.get_column_list( trans, other_values ) ) def get_dependencies( self ): return [ self.data_ref ] - + def need_late_validation( self, trans, context ): + if super( ColumnListParameter, self ).need_late_validation( trans, context ): + return True + # Get the selected dataset if selected + dataset = context[ self.data_ref ] + if dataset: + # Check if the dataset does not have the expected metadata for columns + if not dataset.metadata.columns: + # Only allow late validation if the dataset is not yet ready + # (since we have reason to expect the metadata to be ready eventually) + if dataset.is_pending: + return True + # No late validation + return False + class DrillDownSelectToolParameter( SelectToolParameter ): """
participants (1)
-
Greg Von Kuster