Skip to content
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

Conversation

connor-mccarthy
Copy link
Member

@connor-mccarthy connor-mccarthy commented Apr 25, 2022

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 warning
kfp run create --help should work, but not raise a warning
kfp pipeline upload --help should work, but raise a warning
kfp pipeline create --help should work, but not raise a warning

Checklist:

@connor-mccarthy
Copy link
Member Author

/test all

@google-oss-prow
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@connor-mccarthy
Copy link
Member Author

/hold -- waiting to confirm this alias is desired

@connor-mccarthy
Copy link
Member Author

/retest

@connor-mccarthy connor-mccarthy force-pushed the use-create-for-resource-put-in-cli branch from c8e1dbc to ed62d58 Compare April 27, 2022 17:16
Copy link
Member

@chensun chensun left a 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]):
Copy link
Member

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.
Copy link
Member

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?

Copy link
Member Author

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:

  1. This doesn't work, because DeprecatedAliasGroup is not defined yet:
def deprecated_alias_group_factory(...) -> DeprecatedAliasGroup:
  1. 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?

Copy link
Member

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. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that approach 👍🏻

Copy link
Member Author

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)

@connor-mccarthy
Copy link
Member Author

/unhold

@google-oss-prow google-oss-prow bot removed the lgtm label Apr 27, 2022
Copy link
Member

@chensun chensun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

Thanks!

@google-oss-prow google-oss-prow bot added the lgtm label Apr 29, 2022
@google-oss-prow
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 652ec3b into kubeflow:master Apr 29, 2022
jagadeeshi2i pushed a commit to jagadeeshi2i/pipelines that referenced this pull request May 11, 2022
* 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
abaland pushed a commit to abaland/pipelines that referenced this pull request May 29, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants