-
Notifications
You must be signed in to change notification settings - Fork 139
(torchx/runopt) Allow runopt type to be builtin list[str] and dict[str,str] #1093
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
Conversation
This pull request was exported from Phabricator. Differential Revision: D78767495 |
torchx/specs/api.py
Outdated
@@ -789,6 +789,48 @@ class runopt: | |||
is_required: bool | |||
help: str | |||
|
|||
@property | |||
def is_type_list(self) -> bool: |
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.
should the property be renamed to 'is_type_list_of_str' since the check ensure the elements are of type str?
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.
Agreed, updated
torchx/specs/api.py
Outdated
return self.opt_type in (List[str], list[str]) | ||
|
||
@property | ||
def is_type_dict(self) -> bool: |
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.
similar to is_type_list, should this be more explicitly named as type_dict_of_str?
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.
Same as above, updated
…r,str] (#1093) Summary: As title, supports `list[str]` and `dict[str, str]` types in runopt. Updated testcases to better cover potential type casting issues. Differential Revision: D78767495
531b9a3
to
98974c5
Compare
This pull request was exported from Phabricator. Differential Revision: D78767495 |
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.
looks good
Summary:
As title, supports
list[str]
anddict[str, str]
types in runopt.Updated testcases to better cover potential type casting issues.
Differential Revision: D78767495