-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(sdk): rename CLI methods to 'create' #7607
feat(sdk): rename CLI methods to 'create' #7607
Conversation
/test all |
Skipping CI for Draft Pull Request. |
/hold -- waiting to confirm this alias is desired |
/retest |
c8e1dbc
to
ed62d58
Compare
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.
/lgtm
Thanks!
import click | ||
|
||
|
||
def deprecated_alias_group_factory(deprecated_map: Dict[str, 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.
This is awesome! 👍
|
||
|
||
Returns: | ||
DeprecatedAliasGroup: A class that implements the deprecated alias group. |
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.
nit: type annotate this in the function signature?
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'm not sure if this is possible. My attempts:
- This doesn't work, because
DeprecatedAliasGroup
is not defined yet:
def deprecated_alias_group_factory(...) -> DeprecatedAliasGroup:
- And this doesn't work, because mypy does not support this type for forward ref (mypy error: Name "DeprecatedAliasGroup" is not defined):
def deprecated_alias_group_factory(...) -> 'DeprecatedAliasGroup':
I opted for omission over using Any
. WDYT?
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.
def deprecated_alias_group_factory(...) -> 'DeprecatedAliasGroup':
We have been using this forward declaration pattern in our code base. Now I do recall that mypy would complain on such annotation, but we weren't enforcing the mypy check in the past.
One way to make it "work" is to disable the mypy error on this specific line. Then the annotation might be slightly more helpful for devs looking at this code.
It's very minor. Feel free to ignore my original comment. :)
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 like that approach 👍🏻
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.
Updated (and also fixed one other mypy error)
/unhold |
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.
/lgtm
/approve
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chensun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* add deprecated alias group * add deprecated alias group tests * implement deprecated alias group * clean up other alias tests * clean up docstring * fix type annotations / mypy * format with yapf
* add deprecated alias group * add deprecated alias group tests * implement deprecated alias group * clean up other alias tests * clean up docstring * fix type annotations / mypy * format with yapf
Description of your changes:
Aliases some CLI verbs to be more consistent.
To test on the
kfp
CLI:kfp run submit --help
should work, but raise a warningkfp run create --help
should work, but not raise a warningkfp pipeline upload --help
should work, but raise a warningkfp pipeline create --help
should work, but not raise a warningChecklist:
about the pull request title convention used in this repository.