From e216317ed56e416bd0dcbde16b6cdf61eeb5a5bf Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Sat, 8 Sep 2007 17:41:12 +0000 Subject: [PATCH] I eliminated the conditional on calling Tabular.set_meta() from the ColumnList parameter. This should correct metadata attributes that may have been previoulsy improperly set. Since it is called only when tools that use the ColumnList parameter are loaded, it should not result in concurrent update issues in the database. Keep an eye on the daily job errors, if you see several per day that have an error state with null stderr and traceback values, this may be the culprit. I doubt this will happen though. I also added the customtrack and gbrowsetrack types to Tabular.set_meta() since htey are interval types. --- lib/galaxy/datatypes/tabular.py | 3 ++- lib/galaxy/jobs/__init__.py | 16 ---------------- lib/galaxy/tools/parameters.py | 5 ++--- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index bf547fd35f7..e96e32b4b68 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -95,8 +95,9 @@ class Tabular( data.Text ): if elems[0].lower().startswith(str): proceed = True break - elif format =='tabular' and i > 1: + elif ( format =='tabular' or format == "customtrack" or format == 'gbrowsetrack' ) and i > 1: proceed = True + if proceed: """Set the columns metadata attribute""" if elems_len != dataset.metadata.columns: diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index deb6e550ed8..bee420f394c 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -218,22 +218,6 @@ class JobWrapper( object ): job = model.Job.get( self.job_id ) incoming = dict( [ ( p.name, p.value ) for p in job.parameters ] ) incoming = self.tool.params_from_strings( incoming, self.app ) - """ - Call set_meta on each tabular input dataset if metadata is missing. This - is a temporary work-around to ensure columns metadata attribute is set. - This code will be eliminated soon... - """ - """ - gvk: commented out on 9/6/2007 - This code seems to be causing concurrent update problems in the database. - At the current time, tabular datasets are missing the 'column_types' metadata attribute, which is currently - used only for the ColumnListParameter tool parameter. To be safe, I'm calling Tabular().set_meta() there - anyway, so we don't need this. Also, when we run Dan's script again, it will eliminate the need for this. - - for dataset_assoc in job.input_datasets: - dataset = dataset_assoc.dataset - if issubclass(type(dataset.datatype), type(self.app.datatypes_registry.get_datatype_by_extension('tabular'))) and dataset.missing_meta(): - Tabular().set_meta(dataset) - """ # Resore input / output data lists inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] ) out_data = dict( [ ( da.name, da.dataset ) for da in job.output_datasets ] ) diff --git a/lib/galaxy/tools/parameters.py b/lib/galaxy/tools/parameters.py index 96408835210..f708a085a1c 100644 --- a/lib/galaxy/tools/parameters.py +++ b/lib/galaxy/tools/parameters.py @@ -584,9 +584,8 @@ class ColumnListParameter( SelectToolParameter ): assert dataset is not None, "Error retrieving required dataset for ColumnListParameter" - if dataset.missing_meta(): - """Just to be safe...""" - Tabular().set_meta(dataset) + """Just to be safe...""" + Tabular().set_meta(dataset) if self.numerical: for i, col in enumerate( dataset.metadata.column_types ):