Skip to content

Commit

Permalink
Move declaration of injected attrs into constructor
Browse files Browse the repository at this point in the history
This fixes integration test failures and mypy errors.

For context: https://github.com/galaxyproject/galaxy/pull/14717/files#r1486979280
  • Loading branch information
jdavcs committed Feb 13, 2024
1 parent 37d0a92 commit ca383a8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ class DeclarativeMeta(_DeclarativeMeta, type):
pass

from galaxy.datatypes.data import Data

# from galaxy.tools import DefaultToolState
# from galaxy.workflow.modules import WorkflowModule
from galaxy.tools import DefaultToolState
from galaxy.workflow.modules import WorkflowModule

class _HasTable:
table: Table
Expand Down Expand Up @@ -7841,12 +7840,6 @@ class WorkflowStep(Base, RepresentById):
cascade_backrefs=False,
)

# Injected attributes
# TODO: code using these should be refactored to not depend on these non-persistent fields
module = None
state = None
upgrade_messages = None

STEP_TYPE_TO_INPUT_TYPE = {
"data_input": "dataset",
"data_collection_input": "dataset_collection",
Expand All @@ -7858,6 +7851,11 @@ def __init__(self):
self.uuid = uuid4()
self._input_connections_by_name = None
self._inputs_by_name = None
# Injected attributes
# TODO: code using these should be refactored to not depend on these non-persistent fields
self.module: Optional["WorkflowModule"]
self.state: Optional["DefaultToolState"]
self.upgrade_messages: Optional[Dict]

@reconstructor
def init_on_load(self):
Expand Down

0 comments on commit ca383a8

Please sign in to comment.