Skip to content

Commit

Permalink
IWF-357: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lwolczynski committed Jan 3, 2025
1 parent 7c94d6b commit 3520331
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions iwf/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ def _register_internal_channels(self, wf: ObjectWorkflow):
wf_type = get_workflow_type(wf)

if self._internal_channel_type_store[wf_type] is None:
self._internal_channel_type_store[wf_type] = TypeStore(Type.INTERNAL_CHANNEL)
self._internal_channel_type_store[wf_type] = TypeStore(
Type.INTERNAL_CHANNEL
)

for method in wf.get_communication_schema().communication_methods:
if method.method_type == CommunicationMethodType.InternalChannel:
self._internal_channel_type_store[wf_type].add_internal_channel_def(method)
self._internal_channel_type_store[wf_type].add_internal_channel_def(
method
)

def _register_signal_channels(self, wf: ObjectWorkflow):
wf_type = get_workflow_type(wf)
Expand Down
6 changes: 3 additions & 3 deletions iwf/type_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Type(Enum):
# DATA_ATTRIBUTE = 2
# SIGNAL_CHANNEL = 3


class TypeStore:
_class_type: Type
_name_to_type_store: dict[str, Optional[type]]
Expand Down Expand Up @@ -40,7 +41,6 @@ def add_internal_channel_def(self, obj: CommunicationMethod):
)
self._do_add_to_store(obj.is_prefix, obj.name, obj.value_type)


def _do_get_type(self, name: str) -> Optional[type]:
if name in self._name_to_type_store:
return self._name_to_type_store[name]
Expand All @@ -62,7 +62,7 @@ def _do_add_to_store(self, is_prefix: bool, name: str, t: Optional[type]):

if name in store:
raise WorkflowDefinitionError(
f"{self._class_type} name/prefix {name} already exists")
f"{self._class_type} name/prefix {name} already exists"
)

store[name] = t

0 comments on commit 3520331

Please sign in to comment.