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

add custom url resolver to enable using other endpoints #1914

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

cpkurotori
Copy link
Collaborator

Summary

The service has other environments that need to be accessible via the provider in which the url cannot be properly generated with the current code. To enable using the provider with these environments without hardcoding strategies for these edge cases, I added the option for a custom url resolver.

Details and comments

Use example:

def custom_url(url, instance, private_endpoint = False):
    return "https://my-custom-url"

service=QiskitRuntimeService(channel="ibm_cloud", url="https://test.cloud.ibm.com", instance="crn:v1:my_instance", token="my_token", url_resolver=custom_url)

@kt474 kt474 added the Changelog: New Feature Include in the Added section of the changelog label Sep 9, 2024
Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

Can you also add a release note

@cpkurotori
Copy link
Collaborator Author

Re-requested review because instead of renaming the util function, I figured it would probably be better to deprecate since it is a breaking change.

Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

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

Thank you @cpkurotori!

@kt474 kt474 merged commit 0754905 into Qiskit:main Sep 10, 2024
18 checks passed
@cpkurotori cpkurotori deleted the custom-url branch September 10, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants