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

Issue 1314 | Client: get function by name #1352

Merged
merged 2 commits into from
Jun 4, 2024
Merged

Conversation

IceKhan13
Copy link
Member

@IceKhan13 IceKhan13 commented Jun 3, 2024

Summary

Get function by name using client

client = ServerlessClient(...)

my_function = client.get("my-function")
# <QiskitFunction "my-function">

job = my_function.run()

Details and comments

List programs got feature to filter by title field. So, get client method is reusing this endpoint. It already had all access policies, so it make code changes pretty neat. And also it avoids problems with unique migrations, etc.

Closes #1314

@IceKhan13 IceKhan13 added enhancement New feature or request labels Jun 4, 2024
@IceKhan13 IceKhan13 marked this pull request as ready for review June 4, 2024 14:39
Copy link
Collaborator

@akihikokuroda akihikokuroda 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!

Copy link
Member

@Tansito Tansito left a comment

Choose a reason for hiding this comment

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

LGTM, I didn't update the issue with the changes in #1331 so my fault here. An improvement that we can do in the next version (I'm fine with this approach by now) is to update the interface to guarantee the uniqueness of the function using the new provider interface:

my_function = client.get("my-function")
# this get will look for this title in your private functions (author query)

my_function = client.get("provider/my-function")
# or
my_function = client.get(title="my-function", provider="provider")
# this get will look for this title in the provider

This way we can guarantee the uniqueness of the get method.

@IceKhan13 IceKhan13 merged commit afaf810 into main Jun 4, 2024
17 checks passed
@IceKhan13 IceKhan13 deleted the issue-1314/get-function branch June 4, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creates get end-point with the new ACL
3 participants