From ca28940957c164bd684352761c70281b0c956e56 Mon Sep 17 00:00:00 2001 From: Carter Tinney Date: Tue, 23 Jan 2024 13:27:45 -0800 Subject: [PATCH] modifications --- .../azure/iot/device/iothub/abstract_clients.py | 2 +- .../azure/iot/device/iothub/aio/async_clients.py | 2 +- azure-iot-device/azure/iot/device/iothub/sync_clients.py | 2 +- .../provisioning/aio/async_provisioning_device_client.py | 4 ++-- .../iot/device/provisioning/models/registration_result.py | 6 ++++-- .../iot/device/provisioning/provisioning_device_client.py | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/azure-iot-device/azure/iot/device/iothub/abstract_clients.py b/azure-iot-device/azure/iot/device/iothub/abstract_clients.py index 6fd44f924..1533fc353 100644 --- a/azure-iot-device/azure/iot/device/iothub/abstract_clients.py +++ b/azure-iot-device/azure/iot/device/iothub/abstract_clients.py @@ -5,7 +5,7 @@ # -------------------------------------------------------------------------- """This module contains abstract classes for the various clients of the Azure IoT Hub Device SDK """ -from __future__ import annotations +from __future__ import annotations # Needed for annotation bug < 3.10 import abc import logging import threading diff --git a/azure-iot-device/azure/iot/device/iothub/aio/async_clients.py b/azure-iot-device/azure/iot/device/iothub/aio/async_clients.py index 88ea8987f..30e7ad0b3 100644 --- a/azure-iot-device/azure/iot/device/iothub/aio/async_clients.py +++ b/azure-iot-device/azure/iot/device/iothub/aio/async_clients.py @@ -6,7 +6,7 @@ """This module contains user-facing asynchronous clients for the Azure IoTHub Device SDK for Python. """ -from __future__ import annotations +from __future__ import annotations # Needed for annotation bug < 3.10 import logging import asyncio import deprecation diff --git a/azure-iot-device/azure/iot/device/iothub/sync_clients.py b/azure-iot-device/azure/iot/device/iothub/sync_clients.py index 98d9b8104..0291915de 100644 --- a/azure-iot-device/azure/iot/device/iothub/sync_clients.py +++ b/azure-iot-device/azure/iot/device/iothub/sync_clients.py @@ -6,7 +6,7 @@ """This module contains user-facing synchronous clients for the Azure IoTHub Device SDK for Python. """ -from __future__ import annotations +from __future__ import annotations # Needed for annotation bug < 3.10 import logging import deprecation from .abstract_clients import ( diff --git a/azure-iot-device/azure/iot/device/provisioning/aio/async_provisioning_device_client.py b/azure-iot-device/azure/iot/device/provisioning/aio/async_provisioning_device_client.py index a96032191..33533a7a8 100644 --- a/azure-iot-device/azure/iot/device/provisioning/aio/async_provisioning_device_client.py +++ b/azure-iot-device/azure/iot/device/provisioning/aio/async_provisioning_device_client.py @@ -8,7 +8,7 @@ Device SDK. This client uses Symmetric Key and X509 authentication to register devices with an IoT Hub via the Device Provisioning Service. """ -from __future__ import annotations +from __future__ import annotations # Needed for annotation bug < 3.10 import logging from typing import Any from azure.iot.device.common import async_adapter @@ -27,7 +27,7 @@ logger = logging.getLogger(__name__) -async def handle_result(callback: FunctionOrCoroutine[[Any], None]) -> None: +async def handle_result(callback: FunctionOrCoroutine[[Any], Any]) -> Any: try: return await callback.completion() except pipeline_exceptions.ConnectionDroppedError as e: diff --git a/azure-iot-device/azure/iot/device/provisioning/models/registration_result.py b/azure-iot-device/azure/iot/device/provisioning/models/registration_result.py index a84573c44..3d614c045 100644 --- a/azure-iot-device/azure/iot/device/provisioning/models/registration_result.py +++ b/azure-iot-device/azure/iot/device/provisioning/models/registration_result.py @@ -93,7 +93,9 @@ class RegistrationResult(object): from the provisioning service. """ - def __init__(self, operation_id: str, status: str, registration_state: Optional[RegistrationState] = None): + def __init__( + self, operation_id: str, status: str, registration_state: Optional[RegistrationState] = None + ): """ :param operation_id: The id of the operation as returned by the initial registration request. :param status: The status of the registration process. @@ -114,7 +116,7 @@ def status(self) -> str: return self._status @property - def registration_state(self) -> RegistrationState: + def registration_state(self) -> Optional[RegistrationState]: return self._registration_state def __str__(self): diff --git a/azure-iot-device/azure/iot/device/provisioning/provisioning_device_client.py b/azure-iot-device/azure/iot/device/provisioning/provisioning_device_client.py index fb953b7a4..5bf63755c 100644 --- a/azure-iot-device/azure/iot/device/provisioning/provisioning_device_client.py +++ b/azure-iot-device/azure/iot/device/provisioning/provisioning_device_client.py @@ -8,7 +8,7 @@ Device SDK. This client uses Symmetric Key and X509 authentication to register devices with an IoT Hub via the Device Provisioning Service. """ -from __future__ import annotations +from __future__ import annotations # Needed for annotation bug < 3.10 import logging from typing import Any from azure.iot.device.common.evented_callback import EventedCallback