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

updating from new cosmos spec #16198

Merged
1 commit merged into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AzureTable(object):
:vartype table: azure.data.tables.operations.TableOperations
:ivar service: ServiceOperations operations
:vartype service: azure.data.tables.operations.ServiceOperations
:param url: The URL of the service account or table that is the target of the desired operation.
:param url: The URL of the service account or table that is the targe of the desired operation.
Copy link
Contributor

Choose a reason for hiding this comment

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

lmao, not super high priority but can you pinig the service team about the swagger / add a fix for this

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for finding this, making a PR now.

:type url: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AzureTableConfiguration(Configuration):
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 target of the desired operation.
:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AzureTable(object):
:vartype table: azure.data.tables.aio.operations.TableOperations
:ivar service: ServiceOperations operations
:vartype service: azure.data.tables.aio.operations.ServiceOperations
:param url: The URL of the service account or table that is the target of the desired operation.
:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AzureTableConfiguration(Configuration):
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 target of the desired operation.
:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ async def query(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.TableServiceError, response)
raise HttpResponseError(response=response, model=error)
raise HttpResponseError(response=response)

response_headers = {}
response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
Expand Down Expand Up @@ -393,7 +392,7 @@ async def query_entities(
return deserialized
query_entities.metadata = {'url': '/{table}()'} # type: ignore

async def query_entities_with_partition_and_row_key(
async def query_entity_with_partition_and_row_key(
self,
table: str,
partition_key: str,
Expand All @@ -403,7 +402,7 @@ async def query_entities_with_partition_and_row_key(
query_options: Optional["_models.QueryOptions"] = None,
**kwargs
) -> Dict[str, object]:
"""Queries entities in a table.
"""Queries a single entity in a table.

:param table: The name of the table.
:type table: str
Expand Down Expand Up @@ -440,7 +439,7 @@ async def query_entities_with_partition_and_row_key(
accept = "application/json;odata=minimalmetadata"

# Construct URL
url = self.query_entities_with_partition_and_row_key.metadata['url'] # type: ignore
url = self.query_entity_with_partition_and_row_key.metadata['url'] # type: ignore
path_format_arguments = {
'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
'table': self._serialize.url("table", table, 'str'),
Expand Down Expand Up @@ -491,7 +490,7 @@ async def query_entities_with_partition_and_row_key(
return cls(pipeline_response, deserialized, response_headers)

return deserialized
query_entities_with_partition_and_row_key.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
query_entity_with_partition_and_row_key.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore

async def update_entity(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
from ._models_py3 import TableResponse
from ._models_py3 import TableResponseProperties
from ._models_py3 import TableServiceError
from ._models_py3 import TableServiceErrorOdataError
from ._models_py3 import TableServiceErrorOdataErrorMessage
from ._models_py3 import TableServiceProperties
from ._models_py3 import TableServiceStats
except (SyntaxError, ImportError):
Expand All @@ -40,8 +38,6 @@
from ._models import TableResponse # type: ignore
from ._models import TableResponseProperties # type: ignore
from ._models import TableServiceError # type: ignore
from ._models import TableServiceErrorOdataError # type: ignore
from ._models import TableServiceErrorOdataErrorMessage # type: ignore
from ._models import TableServiceProperties # type: ignore
from ._models import TableServiceStats # type: ignore

Expand All @@ -66,8 +62,6 @@
'TableResponse',
'TableResponseProperties',
'TableServiceError',
'TableServiceErrorOdataError',
'TableServiceErrorOdataErrorMessage',
'TableServiceProperties',
'TableServiceStats',
'GeoReplicationStatusType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,69 +463,25 @@ def __init__(
class TableServiceError(msrest.serialization.Model):
"""Table Service error.

:param odata_error: The odata error.
:type odata_error: ~azure.data.tables.models.TableServiceErrorOdataError
:param message: The error message.
:type message: str
"""

_attribute_map = {
'odata_error': {'key': 'odata\\.error', 'type': 'TableServiceErrorOdataError'},
'message': {'key': 'Message', 'type': 'str', 'xml': {'name': 'Message'}},
}

def __init__(
self,
**kwargs
):
super(TableServiceError, self).__init__(**kwargs)
self.odata_error = kwargs.get('odata_error', None)


class TableServiceErrorOdataError(msrest.serialization.Model):
"""The odata error.

:param code: The service error code. The error codes possible are listed in:
https://docs.microsoft.com/rest/api/storageservices/table-service-error-codes.
:type code: str
:param message: The service error message.
:type message: ~azure.data.tables.models.TableServiceErrorOdataErrorMessage
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'TableServiceErrorOdataErrorMessage'},
_xml_map = {

}

def __init__(
self,
**kwargs
):
super(TableServiceErrorOdataError, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
super(TableServiceError, self).__init__(**kwargs)
self.message = kwargs.get('message', None)


class TableServiceErrorOdataErrorMessage(msrest.serialization.Model):
"""The service error message.

:param lang: Language code of the error message.
:type lang: str
:param value: The error message.
:type value: str
"""

_attribute_map = {
'lang': {'key': 'lang', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(
self,
**kwargs
):
super(TableServiceErrorOdataErrorMessage, self).__init__(**kwargs)
self.lang = kwargs.get('lang', None)
self.value = kwargs.get('value', None)


class TableServiceProperties(msrest.serialization.Model):
"""Table Service Properties.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,77 +522,27 @@ def __init__(
class TableServiceError(msrest.serialization.Model):
"""Table Service error.

:param odata_error: The odata error.
:type odata_error: ~azure.data.tables.models.TableServiceErrorOdataError
:param message: The error message.
:type message: str
"""

_attribute_map = {
'odata_error': {'key': 'odata\\.error', 'type': 'TableServiceErrorOdataError'},
'message': {'key': 'Message', 'type': 'str', 'xml': {'name': 'Message'}},
}

def __init__(
self,
*,
odata_error: Optional["TableServiceErrorOdataError"] = None,
**kwargs
):
super(TableServiceError, self).__init__(**kwargs)
self.odata_error = odata_error


class TableServiceErrorOdataError(msrest.serialization.Model):
"""The odata error.

:param code: The service error code. The error codes possible are listed in:
https://docs.microsoft.com/rest/api/storageservices/table-service-error-codes.
:type code: str
:param message: The service error message.
:type message: ~azure.data.tables.models.TableServiceErrorOdataErrorMessage
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'TableServiceErrorOdataErrorMessage'},
_xml_map = {

}

def __init__(
self,
*,
code: Optional[str] = None,
message: Optional["TableServiceErrorOdataErrorMessage"] = None,
message: Optional[str] = None,
**kwargs
):
super(TableServiceErrorOdataError, self).__init__(**kwargs)
self.code = code
super(TableServiceError, self).__init__(**kwargs)
self.message = message


class TableServiceErrorOdataErrorMessage(msrest.serialization.Model):
"""The service error message.

:param lang: Language code of the error message.
:type lang: str
:param value: The error message.
:type value: str
"""

_attribute_map = {
'lang': {'key': 'lang', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(
self,
*,
lang: Optional[str] = None,
value: Optional[str] = None,
**kwargs
):
super(TableServiceErrorOdataErrorMessage, self).__init__(**kwargs)
self.lang = lang
self.value = value


class TableServiceProperties(msrest.serialization.Model):
"""Table Service Properties.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ def query(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.TableServiceError, response)
raise HttpResponseError(response=response, model=error)
raise HttpResponseError(response=response)

response_headers = {}
response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
Expand Down Expand Up @@ -401,7 +400,7 @@ def query_entities(
return deserialized
query_entities.metadata = {'url': '/{table}()'} # type: ignore

def query_entities_with_partition_and_row_key(
def query_entity_with_partition_and_row_key(
self,
table, # type: str
partition_key, # type: str
Expand All @@ -412,7 +411,7 @@ def query_entities_with_partition_and_row_key(
**kwargs # type: Any
):
# type: (...) -> Dict[str, object]
"""Queries entities in a table.
"""Queries a single entity in a table.

:param table: The name of the table.
:type table: str
Expand Down Expand Up @@ -449,7 +448,7 @@ def query_entities_with_partition_and_row_key(
accept = "application/json;odata=minimalmetadata"

# Construct URL
url = self.query_entities_with_partition_and_row_key.metadata['url'] # type: ignore
url = self.query_entity_with_partition_and_row_key.metadata['url'] # type: ignore
path_format_arguments = {
'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
'table': self._serialize.url("table", table, 'str'),
Expand Down Expand Up @@ -500,7 +499,7 @@ def query_entities_with_partition_and_row_key(
return cls(pipeline_response, deserialized, response_headers)

return deserialized
query_entities_with_partition_and_row_key.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore
query_entity_with_partition_and_row_key.metadata = {'url': '/{table}(PartitionKey=\'{partitionKey}\',RowKey=\'{rowKey}\')'} # type: ignore

def update_entity(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def get_entity(
:caption: Get a single entity from a table
"""
try:
entity = self._client.table.query_entities_with_partition_and_row_key(
entity = self._client.table.query_entity_with_partition_and_row_key(
table=self.table_name,
partition_key=partition_key,
row_key=row_key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ async def get_entity(
:caption: Getting an entity from PartitionKey and RowKey
"""
try:
entity = await self._client.table.query_entities_with_partition_and_row_key(
entity = await self._client.table.query_entity_with_partition_and_row_key(
table=self.table_name,
partition_key=partition_key,
row_key=row_key,
Expand Down