-
Notifications
You must be signed in to change notification settings - Fork 3k
Setting up Python SDK for Personalizer #26296
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
Conversation
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
…zure-sdk-for-python into personalizersdk
sdk/personalizer/azure-ai-personalizer/tests/test_configuration_async.py
Show resolved
Hide resolved
Added @pytest.mark.asyncio decorator for async tests.
…into personalizersdk
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.
Once the tests.yml is moved up a directory, we can run /azp run prepare-pipelines
to create the CI pipeline for your library.
authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential, **kwargs)), | ||
**kwargs | ||
) | ||
self._default_language = kwargs.pop("default_language", 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.
default_language
is specific to the question answering client library, you can remove it. #Resolved
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.
Fixed.
from azure.core.pipeline.policies import AzureKeyCredentialPolicy, AsyncBearerTokenCredentialPolicy | ||
from ._client import PersonalizerClient as PersonalizerClientGenerated | ||
|
||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level |
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 looks like a duplicate, it's defined on L83 #Resolved
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.
Fixed. Thanks!
DESCRIPTION: | ||
This sample demos sending a rank and reward call to personalizer for multi-slot configuration. | ||
USAGE: python multi_slot_rank_actions_and_reward_events_async.py | ||
""" |
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.
We should describe the environment variables needed to run this sample under the comment header. #Resolved
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.
Fixed.
return cast(Iterator[bytes], deserialized) | ||
|
||
@distributed_trace | ||
def import_method(self, body: IO, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements |
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.
import
is a keyword in Python so it looks like the generator is appending "method" to the method name. I missed this on the first review but we should probably give this a better name. Can you rename it through the swagger transform? Should look something like:
directive:
- rename-operation:
from: Model_Import
to: Model_ImportModel
This will rename it to import_model (or whatever it should be named) #Resolved
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.
Thanks for the suggestion. Fixed.
ServiceDirectory: personalizer | ||
MatrixReplace: | ||
- TestSamples=.*/true | ||
Clouds: Canary |
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 don't think we need to run tests in Canary (it doesn't look like we do in the other languages).
Clouds: Canary |
@@ -0,0 +1,18 @@ | |||
trigger: 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.
This file should be up one level: sdk/personalizer/tests.yml #Resolved
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.
Fixed.
692b9c0
to
ef96d81
Compare
/azp run prepare-pipelines |
Azure Pipelines successfully started running 1 pipeline(s). |
Added the comment in github pr. In reply to: 1133773653 |
d4df8e0
to
4859d6d
Compare
API change check APIView has identified API level changes in this PR and created following API reviews. |
All comments have been addressed. This PR is being replaced with a different PR: #26719 |
Abandoning this PR as it had some leaked apikeys (the keys were rotated and so the risk is mitigated). This PR is superceded by this one: #26719 |
Description
Python SDK for Azure Cognitive Services Personalizer.
Swagger link: TBD
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines