-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Regenerate code from connie's swagger change #12979
Changes from 3 commits
36bf244
ffacc80
16c6317
3602b58
053489b
2d2be10
f3c32bd
8bc120f
dce4b92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator}) | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._azure_table import AzureTable | ||
from ._version import VERSION | ||
|
||
__version__ = VERSION | ||
__all__ = ['AzureTable'] | ||
|
||
try: | ||
from ._patch import patch_sdk | ||
from ._patch import patch_sdk # type: ignore | ||
patch_sdk() | ||
except ImportError: | ||
pass |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6282, generator: {generator}) | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
@@ -9,19 +11,20 @@ | |
from azure.core.configuration import Configuration | ||
from azure.core.pipeline import policies | ||
|
||
from ._version import VERSION | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any | ||
|
||
VERSION = "unknown" | ||
|
||
class AzureTableConfiguration(Configuration): | ||
"""Configuration for AzureTable. | ||
|
||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
|
||
:param url: The URL of the service account or table that is the targe of the desired operation. | ||
:param url: The URL of the service account or table that is the target of the desired operation. | ||
:type url: str | ||
""" | ||
|
||
|
@@ -37,7 +40,7 @@ def __init__( | |
|
||
self.url = url | ||
self.version = "2019-02-02" | ||
kwargs.setdefault('sdk_moniker', 'azuretable/{}'.format(VERSION)) | ||
kwargs.setdefault('sdk_moniker', 'table/{}'.format(VERSION)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this too, I think this should be data-tables/ Wondering if we need to regenerate with autorest and specify namespace like, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kristapratico yeah the correct sdk moniker should be 'data-tables'. But we shouldn't need to regenerate, since we're overwriting the generated code's sdk moniker here. Instead, the code I linked should be changed to "data-tables". @seankane-msft can you change this? We tend to keep the user agent in a separate file, that way you can import the constant from the file and use it. TA file example here, and for now, you can just import the user agent constant from that file and set sdk_moniker equal to that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated to user-agent, I think we still need to regen with azure-data-tables otherwise all generated code refs will be off There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah ended up agreeing with you after going through the whole SDK. I don't think it's 100% necessary since it's more for us, but do agree it would look a lot better There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kristapratico @iscai-msft I regenerated this, user-agent isn't used anywhere in this sdk, should I move it to it's own file or should I remove it entirely? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can move it to its own file like how izzy linked above, it's more manageable that way. It looks like the current user-agent string is azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0) and it should look like this: azsdk-python-data-tables/{SDK version} Python/3.8.3 (Windows-10-10.0.19041-SP0) |
||
self._configure(**kwargs) | ||
|
||
def _configure( | ||
|
@@ -49,6 +52,7 @@ def _configure( | |
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) | ||
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) | ||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
|
||
__all__ = ['AzureTable'] | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._azure_table_async import AzureTable | ||
|
||
|
||
__all__ = ['AzureTable'] |
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.
Are we actually using the user-agent string below? This doesn't fit our format:
https://azure.github.io/azure-sdk/general_azurecore.html#telemetry-policy
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.
Also we've talked about this partially offline, @seankane-msft were you able to find out a way to not import this and set the x-ms-version on our side, and just rely on the generated code? I think this can also be addressed in a separate PR as long as there's an issue open for it
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 have not yet, there is an issue out related with the versioning (#12411)