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

improvements to sphinx docs #17159

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions sdk/tables/azure-data-tables/azure/data/tables/_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ def configure_retries(
"""
:param Any request:
:param kwargs:
:return:
:rtype:dict
:return: Dictionary of metadata
:rtype: dict[str, Any]
"""
body_position = None
if hasattr(request.http_request.body, "read"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_service_properties(self, **kwargs):
including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.

:return: Dictionary of service properties
:rtype:dict[str, Any]
:rtype: dict[str, Any]
:raises ~azure.core.exceptions.HttpResponseError:
"""
timeout = kwargs.pop("timeout", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ class TableServiceClient(AsyncStorageAccountHostsMixin, TableServiceClientBase):
:end-before: [END auth_from_shared_key]
:language: python
:dedent: 8
:caption: Creating the tableServiceClient with an account url and credential.
:caption: Creating the TableServiceClient with an account url and credential.

.. literalinclude:: ../samples/async_samples/sample_authentication_async.py
:start-after: [START auth_by_sas]
:end-before: [END auth_by_sas]
:language: python
:dedent: 8
:caption: Creating the tableServiceClient with Shared Access Signature.
:caption: Creating the TableServiceClient with Shared Access Signature.
"""

def __init__(
Expand Down Expand Up @@ -111,7 +111,7 @@ def from_connection_string(
A connection string to an Azure Storage or Cosmos account.
:type conn_str: str
:returns: A Table service client.
:rtype: ~azure.data.tables.TableServiceClient
:rtype: ~azure.data.tables.aio.TableServiceClient

.. admonition:: Example:

Expand All @@ -120,7 +120,7 @@ def from_connection_string(
:end-before: [END auth_from_connection_string]
:language: python
:dedent: 8
:caption: Creating the tableServiceClient from a connection string
:caption: Creating the TableServiceClient from a connection string

"""
account_url, credential = parse_connection_str(
Expand Down Expand Up @@ -156,8 +156,8 @@ async def get_service_properties(self, **kwargs):
including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules.

:keyword callable cls: A custom type or function that will be passed the direct response
:return: TableServiceProperties, or the result of cls(response)
:rtype: ~azure.data.tables.models.TableServiceProperties
:return: Dictionary of service properties
:rtype: dict[str, Any]
:raises ~azure.core.exceptions.HttpResponseError:
"""
timeout = kwargs.pop("timeout", None)
Expand Down Expand Up @@ -210,13 +210,12 @@ async def create_table(
**kwargs # type: Any
):
# type: (...) -> TableClient
"""Creates a new table under the given account.
"""Creates a new table under the current account.

:param headers:
:param table_name: The Table name.
:type table_name: ~azure.data.tables._models.Table
:return: TableClient, or the result of cls(response)
:rtype: ~azure.data.tables.TableClient or None
:type table_name: str
:return: TableClient
:rtype: ~azure.data.tables.aio.TableClient
:raises ~azure.core.exceptions.ResourceExistsError:

.. admonition:: Example:
Expand Down Expand Up @@ -387,8 +386,8 @@ def get_table_client(
The queue. This can either be the name of the queue,
or an instance of QueueProperties.
:type table: str or ~azure.storage.table.TableProperties
:returns: A :class:`~azure.data.tables.TableClient` object.
:rtype: ~azure.data.tables.TableClient
:returns: A :class:`~azure.data.tables.aio.TableClient` object.
:rtype: ~azure.data.tables.aio.TableClient

"""
_pipeline = AsyncPipeline(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ async def create_entity(self):
print("Table already exists")

try:
entity = await table_client.create_entity(entity=self.entity)
print(entity)
resp = await table_client.create_entity(entity=self.entity)
print(resp)
except ResourceExistsError:
print("Entity already exists")
# [END create_entity]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def create_entity(self):

# [START create_entity]
try:
entity = table_client.create_entity(entity=self.entity)
print(entity)
resp = table_client.create_entity(entity=self.entity)
print(resp)
except ResourceExistsError:
print("Entity already exists")
# [END create_entity]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def list_all_entities(self):
table.create_entity(entity=entity1)
# [START query_entities]
# Query the entities in the table
entities = list(table.list_entities())
entities = table.list_entities()

for i, entity in enumerate(entities):
print("Entity #{}: {}".format(entity, i))
Expand Down