-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IWF-397: Add channel sizes data #66
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from typing import Any, Dict, List, Type, TypeVar, Union | ||
|
||
import attr | ||
|
||
from ..types import UNSET, Unset | ||
|
||
T = TypeVar("T", bound="ChannelInfo") | ||
|
||
|
||
@attr.s(auto_attribs=True) | ||
class ChannelInfo: | ||
""" | ||
Attributes: | ||
size (Union[Unset, int]): | ||
""" | ||
|
||
size: Union[Unset, int] = UNSET | ||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) | ||
|
||
def to_dict(self) -> Dict[str, Any]: | ||
size = self.size | ||
|
||
field_dict: Dict[str, Any] = {} | ||
field_dict.update(self.additional_properties) | ||
field_dict.update({}) | ||
if size is not UNSET: | ||
field_dict["size"] = size | ||
|
||
return field_dict | ||
|
||
@classmethod | ||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: | ||
d = src_dict.copy() | ||
size = d.pop("size", UNSET) | ||
|
||
channel_info = cls( | ||
size=size, | ||
) | ||
|
||
channel_info.additional_properties = d | ||
return channel_info | ||
|
||
@property | ||
def additional_keys(self) -> List[str]: | ||
return list(self.additional_properties.keys()) | ||
|
||
def __getitem__(self, key: str) -> Any: | ||
return self.additional_properties[key] | ||
|
||
def __setitem__(self, key: str, value: Any) -> None: | ||
self.additional_properties[key] = value | ||
|
||
def __delitem__(self, key: str) -> None: | ||
del self.additional_properties[key] | ||
|
||
def __contains__(self, key: str) -> bool: | ||
return key in self.additional_properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
iwf/iwf_api/models/workflow_worker_rpc_request_internal_channel_infos.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar | ||
|
||
import attr | ||
|
||
if TYPE_CHECKING: | ||
from ..models.channel_info import ChannelInfo | ||
|
||
|
||
T = TypeVar("T", bound="WorkflowWorkerRpcRequestInternalChannelInfos") | ||
|
||
|
||
@attr.s(auto_attribs=True) | ||
class WorkflowWorkerRpcRequestInternalChannelInfos: | ||
""" """ | ||
|
||
additional_properties: Dict[str, "ChannelInfo"] = attr.ib(init=False, factory=dict) | ||
|
||
def to_dict(self) -> Dict[str, Any]: | ||
pass | ||
|
||
field_dict: Dict[str, Any] = {} | ||
for prop_name, prop in self.additional_properties.items(): | ||
field_dict[prop_name] = prop.to_dict() | ||
|
||
field_dict.update({}) | ||
|
||
return field_dict | ||
|
||
@classmethod | ||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: | ||
from ..models.channel_info import ChannelInfo | ||
|
||
d = src_dict.copy() | ||
workflow_worker_rpc_request_internal_channel_infos = cls() | ||
|
||
additional_properties = {} | ||
for prop_name, prop_dict in d.items(): | ||
additional_property = ChannelInfo.from_dict(prop_dict) | ||
|
||
additional_properties[prop_name] = additional_property | ||
|
||
workflow_worker_rpc_request_internal_channel_infos.additional_properties = ( | ||
additional_properties | ||
) | ||
return workflow_worker_rpc_request_internal_channel_infos | ||
|
||
@property | ||
def additional_keys(self) -> List[str]: | ||
return list(self.additional_properties.keys()) | ||
|
||
def __getitem__(self, key: str) -> "ChannelInfo": | ||
return self.additional_properties[key] | ||
|
||
def __setitem__(self, key: str, value: "ChannelInfo") -> None: | ||
self.additional_properties[key] = value | ||
|
||
def __delitem__(self, key: str) -> None: | ||
del self.additional_properties[key] | ||
|
||
def __contains__(self, key: str) -> bool: | ||
return key in self.additional_properties |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need to check the signal type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean checking if the signal channel exists?
Communication object currently only stores internal channels in the
type_store
. I will need to extend it with_signal_type_store
to do itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Oh that’s right because communication never needed to access that