diff --git a/lib/galaxy/tool_util/parameters/factory.py b/lib/galaxy/tool_util/parameters/factory.py index b98bef854fd8..cd872e43a974 100644 --- a/lib/galaxy/tool_util/parameters/factory.py +++ b/lib/galaxy/tool_util/parameters/factory.py @@ -29,6 +29,7 @@ CwlStringParameterModel, CwlUnionParameterModel, DataCollectionParameterModel, + DataColumnParameterModel, DataParameterModel, DrillDownParameterModel, FloatParameterModel, @@ -159,6 +160,10 @@ def _from_input_source_galaxy(input_source: InputSource) -> ToolParameterT: hierarchy=hierarchy, options=static_options, ) + elif param_type == "data_column": + return DataColumnParameterModel( + name=input_source.parse_name(), + ) else: raise Exception(f"Unknown Galaxy parameter type {param_type}") elif input_type == "conditional": diff --git a/lib/galaxy/tool_util/parameters/models.py b/lib/galaxy/tool_util/parameters/models.py index f3abe7f4c199..a48eec5d705f 100644 --- a/lib/galaxy/tool_util/parameters/models.py +++ b/lib/galaxy/tool_util/parameters/models.py @@ -554,6 +554,21 @@ def request_requires_value(self) -> bool: return self.multiple and not self.optional +class DataColumnParameterModel(BaseGalaxyToolParameterModelDefinition): + parameter_type: Literal["gx_data_column"] = "gx_data_column" + + @property + def py_type(self) -> Type: + return StrictInt + + def pydantic_template(self, state_representation: StateRepresentationT) -> DynamicModelInformation: + return dynamic_model_information_from_py_type(self, self.py_type) + + @property + def request_requires_value(self) -> bool: + return False + + DiscriminatorType = Union[bool, str] @@ -883,6 +898,7 @@ def request_requires_value(self) -> bool: SelectParameterModel, DataParameterModel, DataCollectionParameterModel, + DataColumnParameterModel, DirectoryUriParameterModel, RulesParameterModel, DrillDownParameterModel, diff --git a/test/functional/tools/parameters/gx_data_column.xml b/test/functional/tools/parameters/gx_data_column.xml new file mode 100644 index 000000000000..412150ec3a52 --- /dev/null +++ b/test/functional/tools/parameters/gx_data_column.xml @@ -0,0 +1,36 @@ + + + macros.xml + + > '$output' + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/tool_util/parameter_specification.yml b/test/unit/tool_util/parameter_specification.yml index 39b663888642..f3a82f1febc2 100644 --- a/test/unit/tool_util/parameter_specification.yml +++ b/test/unit/tool_util/parameter_specification.yml @@ -631,6 +631,16 @@ gx_drill_down_exact: - parameter: c - parameter: {} +gx_data_column: + request_valid: + - { ref_parameter: {src: hda, id: abcdabcd}, parameter: 0 } + request_invalid: + - { ref_parameter: {src: hda, id: abcdabcd}, parameter: "0" } + request_internal_valid: + - { ref_parameter: {src: hda, id: 123}, parameter: 0 } + request_internal_invalid: + - { ref_parameter: {src: hda, id: 123}, parameter: "0" } + cwl_int: request_valid: - parameter: 5