Skip to content

Commit

Permalink
Fix wrong extension on pick data output
Browse files Browse the repository at this point in the history
This fixes #18795
  • Loading branch information
mvdbeek committed Sep 11, 2024
1 parent 1dce8cf commit ee63214
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
10 changes: 10 additions & 0 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5704,6 +5704,11 @@ export interface components {
* @description TODO
*/
api_type?: "file" | null;
/**
* Copied From History Dataset Association Id
* @description ID of HDA this HDA was copied from.
*/
copied_from_history_dataset_association_id?: string | null;
/** Copied From Ldda Id */
copied_from_ldda_id?: string | null;
/**
Expand Down Expand Up @@ -5948,6 +5953,11 @@ export interface components {
* @enum {string}
*/
api_type?: "file";
/**
* Copied From History Dataset Association Id
* @description ID of HDA this HDA was copied from.
*/
copied_from_history_dataset_association_id?: string | null;
/** Copied From Ldda Id */
copied_from_ldda_id?: string | null;
/**
Expand Down
12 changes: 9 additions & 3 deletions lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,9 @@ def exec_after_process(self, app, inp_data, out_data, param_dict, job=None, **kw
# if change_datatype PJA is associated with expression tool output the new output already has
# the desired datatype, so we use it. If the extension is "data" there's no change_dataset PJA and
# we want to use the existing extension.
new_ext = output.extension if output.extension != "data" else copy_object.extension
new_ext = (
output.extension if output.extension not in ("data", "expression.json") else copy_object.extension
)
require_metadata_regeneration = copy_object.extension != new_ext
output.copy_from(copy_object, include_metadata=not require_metadata_regeneration)
output.extension = new_ext
Expand All @@ -2895,8 +2897,12 @@ def exec_after_process(self, app, inp_data, out_data, param_dict, job=None, **kw
else:
# TODO: move exec_after_process into metadata script so this doesn't run on the headnode ?
output.init_meta()
output.set_meta()
output.set_metadata_success_state()
try:
output.set_meta()
output.set_metadata_success_state()
except Exception:
output.state = model.HistoryDatasetAssociation.states.FAILED_METADATA
log.exception("Exception occured while setting metdata")

def parse_environment_variables(self, tool_source):
"""Setup environment variable for inputs file."""
Expand Down
2 changes: 1 addition & 1 deletion test/unit/app/managers/test_HDAManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def test_serializers(self):
assert isinstance(serialized["file_size"], int)
assert isinstance(serialized["nice_size"], str)
# TODO: these should be tested w/copy
self.assertNullableEncodedId(serialized["copied_from_history_dataset_association_id"])
assert isinstance(serialized["copied_from_history_dataset_association_id"], int)
self.assertNullableEncodedId(serialized["copied_from_library_dataset_dataset_association_id"])
self.assertNullableBasestring(serialized["info"])
self.assertNullableBasestring(serialized["blurb"])
Expand Down

0 comments on commit ee63214

Please sign in to comment.