Merge pull request #3149 from guerler/fix_hid

Explicitly specify attributes which should be copied to converted datasets
This commit is contained in:
Dannon Baker
2016-11-11 13:28:36 -05:00
committed by GitHub
+10 -1
View File
@@ -2081,8 +2081,8 @@ class DatasetInstance( object ):
except KeyError:
pass # No deps
new_dataset = next(iter(self.datatype.convert_dataset( trans, self, target_ext, return_output=True, visible=False, deps=deps, set_output_history=True, target_context=target_context ).values()))
new_dataset.hid = self.hid
new_dataset.name = self.name
self.copy_attributes( new_dataset )
assoc = ImplicitlyConvertedDatasetAssociation( parent=self, file_type=target_ext, dataset=new_dataset, metadata_safe=False )
session = trans.sa_session
session.add( new_dataset )
@@ -2090,6 +2090,12 @@ class DatasetInstance( object ):
session.flush()
return new_dataset
def copy_attributes( self, new_dataset ):
"""
Copies attributes to a new datasets, used for implicit conversions
"""
pass
def get_metadata_dataset( self, dataset_ext ):
"""
Returns an HDA that points to a metadata file which contains a
@@ -2342,6 +2348,9 @@ class HistoryDatasetAssociation( DatasetInstance, Dictifiable, UsesAnnotations,
object_session( self ).flush()
return hda
def copy_attributes( self, new_dataset ):
new_dataset.hid = self.hid
def to_library_dataset_dataset_association( self, trans, target_folder,
replace_dataset=None, parent_id=None, user=None, roles=None, ldda_message='' ):
"""