diff --git a/.github/workflows/framework_tools.yaml b/.github/workflows/framework_tools.yaml index b2b3c0760caa..1652cb85b005 100644 --- a/.github/workflows/framework_tools.yaml +++ b/.github/workflows/framework_tools.yaml @@ -26,7 +26,7 @@ jobs: strategy: matrix: python-version: ['3.8'] - use-legacy-api: ['if_needed', 'never'] + use-legacy-api: ['if_needed', 'always'] services: postgres: image: postgres:13 diff --git a/lib/galaxy/tool_util/parameters/visitor.py b/lib/galaxy/tool_util/parameters/visitor.py index 5b8e059f2895..107b1dc98aac 100644 --- a/lib/galaxy/tool_util/parameters/visitor.py +++ b/lib/galaxy/tool_util/parameters/visitor.py @@ -18,8 +18,17 @@ ) from .state import ToolState -VISITOR_NO_REPLACEMENT = object() -VISITOR_UNDEFINED = object() + +class VisitorNoReplacement: + pass + + +class VisitorUndefined: + pass + + +VISITOR_NO_REPLACEMENT = VisitorNoReplacement() +VISITOR_UNDEFINED = VisitorUndefined() class Callback(Protocol): @@ -51,11 +60,11 @@ def _visit_input_values( for model in input_models: name = model.name input_value = input_values.get(name, VISITOR_UNDEFINED) + if input_value is VISITOR_UNDEFINED: + continue replacement = callback(model, input_value) if replacement != no_replacement_value: new_input_values[name] = replacement - elif replacement is VISITOR_UNDEFINED: - pass else: new_input_values[name] = input_value return new_input_values diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py index d074c3b8b2c1..78cb2c7ef0a3 100644 --- a/lib/galaxy/tool_util/verify/interactor.py +++ b/lib/galaxy/tool_util/verify/interactor.py @@ -670,7 +670,7 @@ def run_tool( parameters = request_schema["parameters"] def adapt_datasets(test_input: JsonTestDatasetDefDict) -> DataRequest: - return DataRequest(**self.uploads(test_input["path"])) + return DataRequest(**self.uploads[test_input["path"]]) def adapt_collections(test_input: JsonTestCollectionDefDict) -> DataCollectionRequest: test_collection_def = TestCollectionDef.from_dict(test_input) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 38c202e717cc..a9fa1107bb29 100644 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1844,7 +1844,7 @@ def expand_incoming_async(self, request_context: WorkRequestContext, tool_reques job_tool_states: List[JobInternalToolState] collection_info: Optional[MatchingCollections] - job_tool_states, collection_info = expand_meta_parameters_async(trans.app, self, tool_request_internal_state) + job_tool_states, collection_info = expand_meta_parameters_async(request_context.app, self, tool_request_internal_state) self._ensure_expansion_is_valid(job_tool_states, rerun_remap_job_id) @@ -1856,7 +1856,7 @@ def expand_incoming_async(self, request_context: WorkRequestContext, tool_reques all_errors = [] all_params: List[ToolStateJobInstancePopulatedT] = [] for expanded_incoming in job_tool_states: - params, errors = self._populate(request_context, expanded_incoming, input_format) + params, errors = self._populate(request_context, expanded_incoming, "21.01") all_errors.append(errors) all_params.append(params) unset_dataset_matcher_factory(request_context)