Skip to content

Commit

Permalink
Rebase into tool request...
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 1, 2024
1 parent 5bbf756 commit befd96c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/framework_tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 13 additions & 4 deletions lib/galaxy/tool_util/parameters/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/verify/interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit befd96c

Please sign in to comment.