Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into key_docstrings

* 'master' of https://github.com/Azure/azure-sdk-for-python:
  Increment package version after release of azure_identity (Azure#13000)
  README cleanup (receive->Receive_messages, pin 0.50.3 pypi version) and changelog cleanup (remove whitespace) (Azure#13001)
  update changelog release date (Azure#12997)
  Sb ci failure (Azure#12992)
  [Service Bus] Update sample for QueueProperties (Azure#12988)
  • Loading branch information
iscai-msft committed Aug 10, 2020
2 parents 5f28964 + dc8cb54 commit 3bd72c1
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 51 deletions.
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ parameters:
PythonVersion: 'pypy3'
CoverageArg: '--disablecov'
RunForPR: false
AdditionalTestMatrix: []
AdditionalTestMatrix: []

jobs:
- job: 'Build'
Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 3.0.0b1 (Unreleased)
## 3.0.0b1 (2020-08-11)

The version of this package now targets the service's v2.0 API.

Expand Down
3 changes: 3 additions & 0 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release History

## 1.4.1 (Unreleased)


## 1.4.0 (2020-08-10)
### Added
- `DefaultAzureCredential` uses the value of environment variable
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/azure-identity/azure/identity/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
VERSION = "1.4.0"
VERSION = "1.4.1"
3 changes: 0 additions & 3 deletions sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@
- Removed instance variable `received_timestamp_utc` on both type.
- Removed property `settled` on `PeekMessage`.
- Removed property `expired` on `ReceivedMessage`.

* `AutoLockRenew.sleep_time` and `AutoLockRenew.renew_period` have been made internal as `_sleep_time` and `_renew_period` respectively, as it is not expected a user will have to interact with them.
* `AutoLockRenew.shutdown` is now `AutoLockRenew.close` to normalize with other equivalent behaviors.

* Renamed `QueueDescription`, `TopicDescription`, `SubscriptionDescription` and `RuleDescription` to `QueueProperties`, `TopicProperties`, `SubscriptionProperties`, and `RuleProperties`.
* Renamed `QueueRuntimeInfo`, `TopicRuntimeInfo`, and `SubscriptionRuntimeInfo` to `QueueRuntimeProperties`, `TopicRuntimeProperties`, and `SubscriptionRuntimeProperties`.
* Removed param `queue` from `create_queue`, `topic` from `create_topic`, `subscription` from `create_subscription` and `rule` from `create_rule`
of `ServiceBusManagementClient`. Added param `name` to them and keyword arguments for queue properties, topic properties, subscription properties and rule properties.
* Removed model class attributes related keyword arguments from `update_queue` and `update_topic` of `ServiceBusManagementClient`. This is to encourage utilizing the model class instance instead as returned from a create_\*, list_\* or get_\* operation to ensure it is properly populated. Properties may still be modified.
* Model classes `QueueProperties`, `TopicProperties`, `SubscriptionProperties` and `RuleProperties` require all arguments to be present for creation. This is to protect against lack of partial updates by requiring all properties to be specified.

* Renamed `idle_timeout` in `get_<queue/subscription>_receiver()` to `max_wait_time` to normalize with naming elsewhere.
* Updated uAMQP dependency to 1.2.10 such that the receiver does not shut down when generator times out, and can be received from again.

Expand Down
10 changes: 5 additions & 5 deletions sdk/servicebus/azure-servicebus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ There are various timeouts a user should be aware of within the library.
- 10 minute service side link closure: A link, once opened, will be closed after 10 minutes idle to protect the service against resource leakage. This should largely
be transparent to a user, but if you notice a reconnect occurring after such a duration, this is why. Performing any operations, including management operations, on the
link will extend this timeout.
- max_wait_time: Provided on creation of a receiver or when calling `receive()` or `get_streaming_message_iter()`, the time after which receiving messages will halt after no traffic. This applies both to the imperative `receive()` function as well as the length
- max_wait_time: Provided on creation of a receiver or when calling `receive_messages()` or `get_streaming_message_iter()`, the time after which receiving messages will halt after no traffic. This applies both to the imperative `receive_messages()` function as well as the length
a generator-style receive will run for before exiting if there are no messages. Passing None (default) will wait forever, up until the 10 minute threshold if no other action is taken.

> **NOTE:** If processing of a message or session is sufficiently long as to cause timeouts, as an alternative to calling `renew_lock()` manually, one can
Expand Down Expand Up @@ -460,9 +460,9 @@ contact [[email protected]](mailto:[email protected]) with any additio
[receiver_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusReceiver
[sender_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusSender
[client_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusClient
[send_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=send#azure.servicebus.ServiceBusSender.send
[receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=receive#azure.servicebus.ServiceBusReceiver.receive
[session_receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=receive#azure.servicebus.ServiceBusSessionReceiver.receive
[send_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=send_messages#azure.servicebus.ServiceBusSender.send_messages
[receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=receive#azure.servicebus.ServiceBusReceiver.receive_messages
[session_receive_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=receive#azure.servicebus.ServiceBusSessionReceiver.receive_messages
[session_send_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=session_id#azure.servicebus.Message.session_id
[complete_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=complete#azure.servicebus.ReceivedMessage.complete
[abandon_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=abandon#azure.servicebus.ReceivedMessage.abandon
Expand All @@ -473,7 +473,7 @@ contact [[email protected]](mailto:[email protected]) with any additio
[subscription_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.aio.html?highlight=subscription#azure.servicebus.aio.ServiceBusClient.get_subscription_receiver
[topic_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html?highlight=topic#azure.servicebus.ServiceBusClient.get_topic_sender
[0_50_source]: https://github.com/Azure/azure-sdk-for-python/tree/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/
[0_50_pypi]: https://pypi.org/project/azure-servicebus/
[0_50_pypi]: https://pypi.org/project/azure-servicebus/0.50.3/
[0_50_api_docs]:https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/0.50.3/index.html
[0_50_product_docs]: https://docs.microsoft.com/azure/service-bus-messaging/
[0_50_samples]: https://github.com/Azure/azure-sdk-for-python/tree/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/samples
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/azure-servicebus/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Both [sync version](./sync_samples) and [async version](./async_samples) of samp
- Delete a queue
- Update a queue
- List queues
- Get queue description
- Get queue properties
- Get queue runtime information


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
Example to show managing queue entities under a ServiceBus Namespace asynchronously, including
- Create a queue
- Get queue description and runtime information
- Get queue properties and runtime information
- Update a queue
- Delete a queue
- List queues under the given ServiceBus Namespace
Expand All @@ -18,7 +18,6 @@

import os
import asyncio
from azure.servicebus.management import QueueDescription
from azure.servicebus.aio.management import ServiceBusManagementClient

CONNECTION_STR = os.environ['SERVICE_BUS_CONNECTION_STR']
Expand All @@ -27,13 +26,7 @@

async def create_queue(servicebus_mgmt_client):
print("-- Create Queue")
queue_description = QueueDescription(QUEUE_NAME)
# You can adjust the settings of a queue when creating.
# Please refer to the QueueDescription class for available settings.
queue_description.max_delivery_count = 10
queue_description.dead_lettering_on_message_expiration = True

await servicebus_mgmt_client.create_queue(queue_description)
await servicebus_mgmt_client.create_queue(QUEUE_NAME, max_delivery_count=10, dead_lettering_on_message_expiration=True)
print("Queue {} is created.".format(QUEUE_NAME))
print("")

Expand All @@ -47,23 +40,23 @@ async def delete_queue(servicebus_mgmt_client):

async def list_queues(servicebus_mgmt_client):
print("-- List Queues")
async for queue_description in servicebus_mgmt_client.list_queues():
print("Queue Name:", queue_description.name)
async for queue_properties in servicebus_mgmt_client.list_queues():
print("Queue Name:", queue_properties.name)
print("")


async def get_and_update_queue(servicebus_mgmt_client):
print("-- Get and Update Queue")
queue_description = await servicebus_mgmt_client.get_queue(QUEUE_NAME)
print("Queue Name:", queue_description.name)
queue_properties = await servicebus_mgmt_client.get_queue(QUEUE_NAME)
print("Queue Name:", queue_properties.name)
print("Queue Settings:")
print("Auto Delete on Idle:", queue_description.auto_delete_on_idle)
print("Default Message Time to Live:", queue_description.default_message_time_to_live)
print("Dead Lettering on Message Expiration:", queue_description.dead_lettering_on_message_expiration)
print("Please refer to QueueDescription for complete available settings.")
print("Auto Delete on Idle:", queue_properties.auto_delete_on_idle)
print("Default Message Time to Live:", queue_properties.default_message_time_to_live)
print("Dead Lettering on Message Expiration:", queue_properties.dead_lettering_on_message_expiration)
print("Please refer to QueueProperties for complete available settings.")
print("")
queue_description.max_delivery_count = 5
await servicebus_mgmt_client.update_queue(queue_description)
queue_properties.max_delivery_count = 5
await servicebus_mgmt_client.update_queue(queue_properties)


async def get_queue_runtime_info(servicebus_mgmt_client):
Expand All @@ -73,7 +66,7 @@ async def get_queue_runtime_info(servicebus_mgmt_client):
print("Queue Runtime Info:")
print("Updated at:", queue_runtime_info.updated_at)
print("Size in Bytes:", queue_runtime_info.size_in_bytes)
print("Message Count:", queue_runtime_info.message_count)
print("Message Count:", queue_runtime_info.total_message_count)
print("Please refer to QueueRuntimeInfo from complete available runtime information.")
print("")

Expand Down
32 changes: 13 additions & 19 deletions sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
Example to show managing queue entities under a ServiceBus Namespace, including
- Create a queue
- Get queue description and runtime information
- Get queue properties and runtime information
- Update a queue
- Delete a queue
- List queues under the given ServiceBus Namespace
Expand All @@ -17,21 +17,15 @@
# pylint: disable=C0111

import os
from azure.servicebus.management import ServiceBusManagementClient, QueueDescription
from azure.servicebus.management import ServiceBusManagementClient

CONNECTION_STR = os.environ['SERVICE_BUS_CONNECTION_STR']
QUEUE_NAME = "sb_mgmt_demo_queue"


def create_queue(servicebus_mgmt_client):
print("-- Create Queue")
queue_description = QueueDescription(QUEUE_NAME)
# You can adjust the settings of a queue when creating.
# Please refer to the QueueDescription class for available settings.
queue_description.max_delivery_count = 10
queue_description.dead_lettering_on_message_expiration = True

servicebus_mgmt_client.create_queue(queue_description)
servicebus_mgmt_client.create_queue(QUEUE_NAME, max_delivery_count=10, dead_lettering_on_message_expiration=True)
print("Queue {} is created.".format(QUEUE_NAME))
print("")

Expand All @@ -45,23 +39,23 @@ def delete_queue(servicebus_mgmt_client):

def list_queues(servicebus_mgmt_client):
print("-- List Queues")
for queue_description in servicebus_mgmt_client.list_queues():
print("Queue Name:", queue_description.name)
for queue_properties in servicebus_mgmt_client.list_queues():
print("Queue Name:", queue_properties.name)
print("")


def get_and_update_queue(servicebus_mgmt_client):
print("-- Get and Update Queue")
queue_description = servicebus_mgmt_client.get_queue(QUEUE_NAME)
print("Queue Name:", queue_description.name)
queue_properties = servicebus_mgmt_client.get_queue(QUEUE_NAME)
print("Queue Name:", queue_properties.name)
print("Queue Settings:")
print("Auto Delete on Idle:", queue_description.auto_delete_on_idle)
print("Default Message Time to Live:", queue_description.default_message_time_to_live)
print("Dead Lettering on Message Expiration:", queue_description.dead_lettering_on_message_expiration)
print("Auto Delete on Idle:", queue_properties.auto_delete_on_idle)
print("Default Message Time to Live:", queue_properties.default_message_time_to_live)
print("Dead Lettering on Message Expiration:", queue_properties.dead_lettering_on_message_expiration)
print("Please refer to QueueDescription for complete available settings.")
print("")
queue_description.max_delivery_count = 5
servicebus_mgmt_client.update_queue(queue_description)
queue_properties.max_delivery_count = 5
servicebus_mgmt_client.update_queue(queue_properties)


def get_queue_runtime_info(servicebus_mgmt_client):
Expand All @@ -71,7 +65,7 @@ def get_queue_runtime_info(servicebus_mgmt_client):
print("Queue Runtime Info:")
print("Updated at:", queue_runtime_info.updated_at)
print("Size in Bytes:", queue_runtime_info.size_in_bytes)
print("Message Count:", queue_runtime_info.message_count)
print("Message Count:", queue_runtime_info.total_message_count)
print("Please refer to QueueRuntimeInfo from complete available runtime information.")
print("")

Expand Down

0 comments on commit 3bd72c1

Please sign in to comment.