-
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): Add filters to python client. #6748
Conversation
Hi @jmcarp. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
The backend and generated python code accept filters for resource list requests, but we don't expose those in the client.
Just curious, when was the filter
option added? Is there a minimum version of backend/API that we need to be aware of for this change?
@@ -506,7 +506,8 @@ def list_experiments(self, | |||
page_token='', | |||
page_size=10, | |||
sort_by='', | |||
namespace=None): | |||
namespace=None, | |||
filter=None): |
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.
Can you please document this argument below in the function docstring?
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.
Done!
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.
The link there is now broken.
https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto
@@ -1061,7 +1066,8 @@ def list_runs(self, | |||
page_size=10, | |||
sort_by='', | |||
experiment_id=None, | |||
namespace=None): | |||
namespace=None, | |||
filter=None): |
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.
ditto: docstring
return response | ||
|
||
def list_recurring_runs(self, | ||
page_token='', | ||
page_size=10, | ||
sort_by='', | ||
experiment_id=None): | ||
experiment_id=None, | ||
filter=None): |
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.
ditto
I took a look, seems to be there for a long time, no need to worry about the minimum version. Can you please add an entry in the release note under "Current version" ? https://github.com/kubeflow/pipelines/blob/master/sdk/RELEASE.md |
4d8d925
to
8830060
Compare
Updated @chensun. |
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!
sdk/RELEASE.md
Outdated
@@ -17,6 +17,7 @@ | |||
|
|||
* Fix placeholder mapping error in v2. [\#6794](https://github.com/kubeflow/pipelines/pull/6794) | |||
* Depends on `kfp-pipeline-spec>=0.1.13,<0.2.0` [\#6803](https://github.com/kubeflow/pipelines/pull/6803) | |||
* Add optional `filter` argument to list methods of KFP client. |
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: Add the PR link at the end just like the rest? See if you want to edit this yourself, or I can help as well.
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
8830060
to
2fdfb61
Compare
/lgtm 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 |
/lgtm |
@jmcarp: The following test failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Adding another data point to #6815 One of the print_op in a loop failed with error:
All the rest print_ops succeeded. Going to ignore the test failure and merge as-is. |
This feature would be much easier to use if there were Python types available for the filter. See #8778 |
Description of your changes:
The backend and generated python code accept filters for resource list requests, but we don't expose those in the client. This patch exposes filters as appropriate as json-encoded strings. Note: we might want to accept filters as lists of dicts, or we could generate python classes from
filters.proto
and pass inFilter
objects instead. Any preference on this?Checklist: