Skip to content

Commit

Permalink
Fix signature override of WorkflowModule.save_to_step() method
Browse files Browse the repository at this point in the history
Fix the following mypy 1.11 errors:

```
lib/galaxy/workflow/modules.py:650: error: Signature of "save_to_step"
incompatible with supertype "WorkflowModule"  [override]
        def save_to_step(self, step, **kwd):
        ^
lib/galaxy/workflow/modules.py:650: note:      Superclass:
lib/galaxy/workflow/modules.py:650: note:          def save_to_step(self, step: Any, detached: Any = ...) -> Any
lib/galaxy/workflow/modules.py:650: note:      Subclass:
lib/galaxy/workflow/modules.py:650: note:          def save_to_step(self, step: Any, **kwd: Any) -> Any
lib/galaxy/workflow/modules.py:1030: error: Signature of "save_to_step"
incompatible with supertype "WorkflowModule"  [override]
        def save_to_step(self, step, **kwd):
        ^
lib/galaxy/workflow/modules.py:1030: note:      Superclass:
lib/galaxy/workflow/modules.py:1030: note:          def save_to_step(self, step: Any, detached: Any = ...) -> Any
lib/galaxy/workflow/modules.py:1030: note:      Subclass:
lib/galaxy/workflow/modules.py:1030: note:          def save_to_step(self, step: Any, **kwd: Any) -> Any
lib/galaxy/workflow/modules.py:1680: error: Signature of "save_to_step"
incompatible with supertype "WorkflowModule"  [override]
        def save_to_step(self, step, **kwd):
        ^
lib/galaxy/workflow/modules.py:1680: note:      Superclass:
lib/galaxy/workflow/modules.py:1680: note:          def save_to_step(self, step: Any, detached: Any = ...) -> Any
lib/galaxy/workflow/modules.py:1680: note:      Subclass:
lib/galaxy/workflow/modules.py:1680: note:          def save_to_step(self, step: Any, **kwd: Any) -> Any
```
  • Loading branch information
nsoranzo committed Sep 10, 2024
1 parent eb8eee4 commit 1a9f7d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/galaxy/workflow/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def from_workflow_step(Class, trans, step, **kwds):

# ---- Saving in various forms ------------------------------------------

def save_to_step(self, step, detached=False):
def save_to_step(self, step, detached: bool = False) -> None:
step.type = self.type
step.tool_inputs = self.get_state()

Expand Down Expand Up @@ -647,7 +647,7 @@ def from_workflow_step(Class, trans, step, **kwds):
module.subworkflow = step.subworkflow
return module

def save_to_step(self, step, **kwd):
def save_to_step(self, step, detached=False):
step.type = self.type
step.subworkflow = self.subworkflow
ensure_object_added_to_session(step, object_in_session=self.subworkflow)
Expand Down Expand Up @@ -1027,7 +1027,7 @@ def step_state_to_tool_state(self, state):
state = json.dumps(state)
return state

def save_to_step(self, step, **kwd):
def save_to_step(self, step, detached=False):
step.type = self.type
step.tool_inputs = self._parse_state_into_dict()

Expand Down Expand Up @@ -1677,7 +1677,7 @@ def _string_to_parameter_def_option(str_value):
rval.update({"parameter_type": self.default_parameter_type, "optional": self.default_optional})
return rval

def save_to_step(self, step, **kwd):
def save_to_step(self, step, detached=False):
step.type = self.type
step.tool_inputs = self._parse_state_into_dict()

Expand Down

0 comments on commit 1a9f7d6

Please sign in to comment.