Skip to content

Commit

Permalink
Addressed more feedback comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharathmalladi committed Oct 7, 2022
1 parent c929c2a commit 692b9c0
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
from azure.core.pipeline.policies import AzureKeyCredentialPolicy, BearerTokenCredentialPolicy
from ._client import PersonalizerClient as PersonalizerClientGenerated

__all__ = ["PersonalizerClient"] # Add all objects you want publicly available to users at this package level
__all__: List[str] = [
"PersonalizerClient"
] # Add all objects you want publicly available to users at this package level


def _authentication_policy(credential, **kwargs):
if credential is None:
Expand Down Expand Up @@ -73,7 +76,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, TokenCre
authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential, **kwargs)),
**kwargs
)
self._default_language = kwargs.pop("default_language", None)


def patch_sdk():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
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
__all__: List[str] = [
"PersonalizerClient"
] # Add all objects you want publicly available to users at this package level


def _authentication_policy(credential, **kwargs):
if credential is None:
Expand Down Expand Up @@ -80,11 +83,6 @@ def __init__(
self._default_language = kwargs.pop("default_language", None)


__all__: List[str] = [
"PersonalizerClient"
] # Add all objects you want publicly available to users at this package level


def patch_sdk():
"""Do not remove from this file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
build_log_get_properties_request,
build_model_get_properties_request,
build_model_get_request,
build_model_import_method_request,
build_model_import_model_request,
build_model_reset_request,
build_multi_slot_events_activate_request,
build_multi_slot_events_reward_request,
Expand Down Expand Up @@ -2139,7 +2139,7 @@ async def get(self, *, signed: bool = False, **kwargs: Any) -> AsyncIterator[byt
return cast(AsyncIterator[bytes], deserialized)

@distributed_trace_async
async def import_method(self, body: IO, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
async def import_model(self, body: IO, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
"""Model File.
Replace the existing model file for the Personalizer service.
Expand All @@ -2166,7 +2166,7 @@ async def import_method(self, body: IO, **kwargs: Any) -> None: # pylint: disab

_content = body

request = build_model_import_method_request(
request = build_model_import_model_request(
content_type=content_type,
api_version=self._config.api_version,
content=_content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def build_model_get_request(*, signed: bool = False, **kwargs: Any) -> HttpReque
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)


def build_model_import_method_request(*, content: IO, **kwargs: Any) -> HttpRequest:
def build_model_import_model_request(*, content: IO, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

Expand Down Expand Up @@ -2716,7 +2716,7 @@ def get(self, *, signed: bool = False, **kwargs: Any) -> Iterator[bytes]:
return cast(Iterator[bytes], deserialized)

@distributed_trace
def import_method(self, body: IO, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
def import_model(self, body: IO, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
"""Model File.
Replace the existing model file for the Personalizer service.
Expand All @@ -2743,7 +2743,7 @@ def import_method(self, body: IO, **kwargs: Any) -> None: # pylint: disable=inc

_content = body

request = build_model_import_method_request(
request = build_model_import_model_request(
content_type=content_type,
api_version=self._config.api_version,
content=_content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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
Environment variables PERSONALIZER_ENDPOINT and PERSONALIZER_API_KEY must be set as per your personalizer instance.
"""
import asyncio
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DESCRIPTION:
This sample demos sending a rank and reward call to personalizer
USAGE: python rank_actions_and_reward_events_async.py
Environment variables PERSONALIZER_ENDPOINT and PERSONALIZER_API_KEY must be set as per your personalizer instance.
"""
import asyncio
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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.py
Environment variables PERSONALIZER_ENDPOINT and PERSONALIZER_API_KEY must be set as per your personalizer instance.
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DESCRIPTION:
This sample demos sending a rank and reward call to personalizer
USAGE: python rank_actions_and_reward_events.py
Environment variables PERSONALIZER_ENDPOINT and PERSONALIZER_API_KEY must be set as per your personalizer instance.
"""
import os
import sys
Expand Down
3 changes: 3 additions & 0 deletions sdk/personalizer/azure-ai-personalizer/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ directive:
- where-operation: Evaluations_List
transform: >
$.parameters[1]["x-ms-client-name"] = "filter_expression";
- rename-operation:
from: Model_Import
to: Model_ImportModel
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ stages:
ServiceDirectory: personalizer
MatrixReplace:
- TestSamples=.*/true
Clouds: Canary
EnvVars:
AZURE_CLIENT_ID: $(PERSONALIZER_CLIENT_ID)
AZURE_TENANT_ID: $(PERSONALIZER_TENANT_ID)
Expand Down

0 comments on commit 692b9c0

Please sign in to comment.