Skip to content

Commit

Permalink
Skip change_datatype things if we're not actually changing the extension
Browse files Browse the repository at this point in the history
Side-steps a problem with FileParameter in the most efficient way
possible. This likely became a problem for one of Wolfgang's workflow
afer we dropped some earlier unnecessary flushes.
  • Loading branch information
mvdbeek committed Oct 26, 2023
1 parent f620b11 commit ca5132d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/galaxy/datatypes/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,13 +590,14 @@ def get_datatype_by_extension(self, ext):
return self.datatypes_by_extension.get(ext, None)

def change_datatype(self, data, ext):
data.extension = ext
# call init_meta and copy metadata from itself. The datatype
# being converted *to* will handle any metadata copying and
# initialization.
if data.has_data():
data.set_size()
data.init_meta(copy_from=data)
if data.extension != ext:
data.extension = ext
# call init_meta and copy metadata from itself. The datatype
# being converted *to* will handle any metadata copying and
# initialization.
if data.has_data():
data.set_size()
data.init_meta(copy_from=data)
return data

def load_datatype_converters(self, toolbox, use_cached=False):
Expand Down

0 comments on commit ca5132d

Please sign in to comment.