Skip to content

Commit 9978952

Browse files
Yalin Lil0lawrence
Yalin Li
authored andcommitted
[Appconfig] Fix content validation issues for github.io (Azure#37281)
1 parent 421c2a7 commit 9978952

File tree

5 files changed

+37
-33
lines changed

5 files changed

+37
-33
lines changed

sdk/appconfiguration/azure-appconfiguration/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ See the [troubleshooting guide][troubleshooting_guide] for details on how to dia
420420
Several App Configuration client library samples are available to you in this GitHub repository. These include:
421421
- [Hello world](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample_async.py)
422422
- [List configuration settings](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_configuration_settings_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_configuration_settings_sample_async.py)
423-
- [Make a configuration setting readonly](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/read_only_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample_async.py)
423+
- [Make a configuration setting readonly](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/read_only_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/read_only_sample_async.py)
424424
- [Read revision history](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_revision_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_revision_sample_async.py)
425425
- [Get a setting if changed](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/conditional_operation_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/conditional_operation_sample_async.py)
426426
- [Create, retrieve and update status of a configuration settings snapshot](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/snapshot_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/snapshot_sample_async.py)

sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py

+17-14
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure
110110
.. code-block:: python
111111
112112
from azure.appconfiguration import AzureAppConfigurationClient
113+
113114
connection_str = "<my connection string>"
114115
client = AzureAppConfigurationClient.from_connection_string(connection_str)
115116
"""
@@ -123,7 +124,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure
123124
)
124125

125126
@distributed_trace
126-
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs) -> HttpResponse:
127+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
127128
"""Runs a network request using the client's existing pipeline.
128129
129130
The request URL can be relative to the vault URL. The service API version used for the request is the same as
@@ -212,7 +213,7 @@ def list_configuration_settings(
212213
"""
213214

214215
@distributed_trace
215-
def list_configuration_settings(self, *args, **kwargs) -> ItemPaged[ConfigurationSetting]:
216+
def list_configuration_settings(self, *args: Optional[str], **kwargs: Any) -> ItemPaged[ConfigurationSetting]:
216217
accept_datetime = kwargs.pop("accept_datetime", None)
217218
if isinstance(accept_datetime, datetime):
218219
accept_datetime = str(accept_datetime)
@@ -252,7 +253,7 @@ def get_configuration_setting(
252253
match_condition: MatchConditions = MatchConditions.Unconditionally,
253254
*,
254255
accept_datetime: Optional[Union[datetime, str]] = None,
255-
**kwargs,
256+
**kwargs: Any,
256257
) -> Union[None, ConfigurationSetting]:
257258
"""Get the matched ConfigurationSetting from Azure App Configuration service
258259
@@ -308,7 +309,9 @@ def get_configuration_setting(
308309
return None
309310

310311
@distributed_trace
311-
def add_configuration_setting(self, configuration_setting: ConfigurationSetting, **kwargs) -> ConfigurationSetting:
312+
def add_configuration_setting(
313+
self, configuration_setting: ConfigurationSetting, **kwargs: Any
314+
) -> ConfigurationSetting:
312315
"""Add a ConfigurationSetting instance into the Azure App Configuration service.
313316
314317
:param configuration_setting: The ConfigurationSetting object to be added
@@ -351,7 +354,7 @@ def set_configuration_setting(
351354
match_condition: MatchConditions = MatchConditions.Unconditionally,
352355
*,
353356
etag: Optional[str] = None,
354-
**kwargs,
357+
**kwargs: Any,
355358
) -> ConfigurationSetting:
356359
"""Add or update a ConfigurationSetting.
357360
If the configuration setting identified by key and label does not exist, this is a create.
@@ -418,7 +421,7 @@ def delete_configuration_setting( # pylint:disable=delete-operation-wrong-retur
418421
*,
419422
etag: Optional[str] = None,
420423
match_condition: MatchConditions = MatchConditions.Unconditionally,
421-
**kwargs,
424+
**kwargs: Any,
422425
) -> Union[None, ConfigurationSetting]:
423426
"""Delete a ConfigurationSetting if it exists
424427
@@ -478,7 +481,7 @@ def list_revisions(
478481
tags_filter: Optional[List[str]] = None,
479482
accept_datetime: Optional[Union[datetime, str]] = None,
480483
fields: Optional[List[Union[str, ConfigurationSettingFields]]] = None,
481-
**kwargs,
484+
**kwargs: Any,
482485
) -> ItemPaged[ConfigurationSetting]:
483486
"""
484487
Find the ConfigurationSetting revision history, optionally filtered by key, label, tags and accept_datetime.
@@ -543,7 +546,7 @@ def set_read_only(
543546
read_only: bool = True,
544547
*,
545548
match_condition: MatchConditions = MatchConditions.Unconditionally,
546-
**kwargs,
549+
**kwargs: Any,
547550
) -> ConfigurationSetting:
548551
"""Set a configuration setting read only
549552
@@ -608,7 +611,7 @@ def list_labels(
608611
after: Optional[str] = None,
609612
accept_datetime: Optional[Union[datetime, str]] = None,
610613
fields: Optional[List[Union[str, LabelFields]]] = None,
611-
**kwargs,
614+
**kwargs: Any,
612615
) -> ItemPaged[ConfigurationSettingLabel]:
613616
"""Gets a list of labels.
614617
@@ -649,7 +652,7 @@ def begin_create_snapshot(
649652
composition_type: Optional[Union[str, SnapshotComposition]] = None,
650653
retention_period: Optional[int] = None,
651654
tags: Optional[Dict[str, str]] = None,
652-
**kwargs,
655+
**kwargs: Any,
653656
) -> LROPoller[ConfigurationSnapshot]:
654657
"""Create a snapshot of the configuration settings.
655658
@@ -692,7 +695,7 @@ def archive_snapshot(
692695
*,
693696
match_condition: MatchConditions = MatchConditions.Unconditionally,
694697
etag: Optional[str] = None,
695-
**kwargs,
698+
**kwargs: Any,
696699
) -> ConfigurationSnapshot:
697700
"""Archive a configuration setting snapshot. It will update the status of a snapshot from "ready" to "archived".
698701
The retention period will start to count, the snapshot will expire when the entire retention period elapses.
@@ -733,7 +736,7 @@ def recover_snapshot(
733736
*,
734737
match_condition: MatchConditions = MatchConditions.Unconditionally,
735738
etag: Optional[str] = None,
736-
**kwargs,
739+
**kwargs: Any,
737740
) -> ConfigurationSnapshot:
738741
"""Recover a configuration setting snapshot. It will update the status of a snapshot from "archived" to "ready".
739742
@@ -768,7 +771,7 @@ def recover_snapshot(
768771

769772
@distributed_trace
770773
def get_snapshot(
771-
self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs
774+
self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs: Any
772775
) -> ConfigurationSnapshot:
773776
"""Get a configuration setting snapshot.
774777
@@ -793,7 +796,7 @@ def list_snapshots(
793796
name: Optional[str] = None,
794797
fields: Optional[List[Union[str, SnapshotFields]]] = None,
795798
status: Optional[List[Union[str, SnapshotStatus]]] = None,
796-
**kwargs,
799+
**kwargs: Any,
797800
) -> ItemPaged[ConfigurationSnapshot]:
798801
"""List the configuration setting snapshots stored in the configuration service, optionally filtered by
799802
snapshot name, snapshot status and fields to present in return.

sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ class ConfigurationSettingPropertiesPaged(PageIterator):
581581
etag: str
582582
"""The etag of current page."""
583583

584-
def __init__(self, command: Callable, **kwargs):
584+
def __init__(self, command: Callable, **kwargs: Any):
585585
super(ConfigurationSettingPropertiesPaged, self).__init__(
586586
self._get_next_cb,
587587
self._extract_data_cb,
@@ -620,7 +620,7 @@ class ConfigurationSettingPropertiesPagedAsync(AsyncPageIterator):
620620
etag: str
621621
"""The etag of current page."""
622622

623-
def __init__(self, command: Callable, **kwargs):
623+
def __init__(self, command: Callable, **kwargs: Any):
624624
super(ConfigurationSettingPropertiesPagedAsync, self).__init__(
625625
self._get_next_cb,
626626
self._extract_data_cb,

sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_current_utc_time() -> str:
6767
return str(datetime.utcnow().strftime("%b, %d %Y %H:%M:%S.%f ")) + "GMT"
6868

6969

70-
def get_key_filter(*args, **kwargs) -> Tuple[Optional[str], Dict[str, Any]]:
70+
def get_key_filter(*args: Optional[str], **kwargs: Any) -> Tuple[Optional[str], Dict[str, Any]]:
7171
key_filter = None
7272
if len(args) > 0:
7373
key_filter = args[0]
@@ -79,7 +79,7 @@ def get_key_filter(*args, **kwargs) -> Tuple[Optional[str], Dict[str, Any]]:
7979
return key_filter or kwargs.pop("key_filter", None), kwargs
8080

8181

82-
def get_label_filter(*args, **kwargs) -> Tuple[Optional[str], Dict[str, Any]]:
82+
def get_label_filter(*args: Optional[str], **kwargs: Any) -> Tuple[Optional[str], Dict[str, Any]]:
8383
label_filter = None
8484
if len(args) > 1:
8585
label_filter = args[1]

sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_appconfiguration_client_async.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure
116116
.. code-block:: python
117117
118118
from azure.appconfiguration.aio import AzureAppConfigurationClient
119+
119120
connection_str = "<my connection string>"
120121
async_client = AzureAppConfigurationClient.from_connection_string(connection_str)
121122
"""
@@ -129,7 +130,7 @@ def from_connection_string(cls, connection_string: str, **kwargs: Any) -> "Azure
129130
)
130131

131132
@distributed_trace_async
132-
async def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs) -> AsyncHttpResponse:
133+
async def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> AsyncHttpResponse:
133134
"""Runs a network request using the client's existing pipeline.
134135
135136
The request URL can be relative to the vault URL. The service API version used for the request is the same as
@@ -218,7 +219,7 @@ def list_configuration_settings(
218219
"""
219220

220221
@distributed_trace
221-
def list_configuration_settings(self, *args, **kwargs) -> AsyncItemPaged[ConfigurationSetting]:
222+
def list_configuration_settings(self, *args: Optional[str], **kwargs: Any) -> AsyncItemPaged[ConfigurationSetting]:
222223
accept_datetime = kwargs.pop("accept_datetime", None)
223224
if isinstance(accept_datetime, datetime):
224225
accept_datetime = str(accept_datetime)
@@ -259,7 +260,7 @@ async def get_configuration_setting(
259260
match_condition: MatchConditions = MatchConditions.Unconditionally,
260261
*,
261262
accept_datetime: Optional[Union[datetime, str]] = None,
262-
**kwargs,
263+
**kwargs: Any,
263264
) -> Union[None, ConfigurationSetting]:
264265
"""Get the matched ConfigurationSetting from Azure App Configuration service
265266
@@ -317,7 +318,7 @@ async def get_configuration_setting(
317318

318319
@distributed_trace_async
319320
async def add_configuration_setting(
320-
self, configuration_setting: ConfigurationSetting, **kwargs
321+
self, configuration_setting: ConfigurationSetting, **kwargs: Any
321322
) -> ConfigurationSetting:
322323
"""Add a ConfigurationSetting instance into the Azure App Configuration service.
323324
@@ -363,7 +364,7 @@ async def set_configuration_setting(
363364
match_condition: MatchConditions = MatchConditions.Unconditionally,
364365
*,
365366
etag: Optional[str] = None,
366-
**kwargs,
367+
**kwargs: Any,
367368
) -> ConfigurationSetting:
368369
"""Add or update a ConfigurationSetting.
369370
If the configuration setting identified by key and label does not exist, this is a create.
@@ -431,7 +432,7 @@ async def delete_configuration_setting(
431432
*,
432433
etag: Optional[str] = None,
433434
match_condition: MatchConditions = MatchConditions.Unconditionally,
434-
**kwargs,
435+
**kwargs: Any,
435436
) -> Union[None, ConfigurationSetting]:
436437
"""Delete a ConfigurationSetting if it exists
437438
@@ -492,7 +493,7 @@ def list_revisions(
492493
tags_filter: Optional[List[str]] = None,
493494
accept_datetime: Optional[Union[datetime, str]] = None,
494495
fields: Optional[List[Union[str, ConfigurationSettingFields]]] = None,
495-
**kwargs,
496+
**kwargs: Any,
496497
) -> AsyncItemPaged[ConfigurationSetting]:
497498
"""
498499
Find the ConfigurationSetting revision history, optionally filtered by key, label, tags and accept_datetime.
@@ -558,7 +559,7 @@ async def set_read_only(
558559
read_only: bool = True,
559560
*,
560561
match_condition: MatchConditions = MatchConditions.Unconditionally,
561-
**kwargs,
562+
**kwargs: Any,
562563
) -> ConfigurationSetting:
563564
"""Set a configuration setting read only
564565
@@ -623,7 +624,7 @@ def list_labels(
623624
after: Optional[str] = None,
624625
accept_datetime: Optional[Union[datetime, str]] = None,
625626
fields: Optional[List[Union[str, LabelFields]]] = None,
626-
**kwargs,
627+
**kwargs: Any,
627628
) -> AsyncItemPaged[ConfigurationSettingLabel]:
628629
"""Gets a list of labels.
629630
@@ -664,7 +665,7 @@ async def begin_create_snapshot(
664665
composition_type: Optional[Union[str, SnapshotComposition]] = None,
665666
retention_period: Optional[int] = None,
666667
tags: Optional[Dict[str, str]] = None,
667-
**kwargs,
668+
**kwargs: Any,
668669
) -> AsyncLROPoller[ConfigurationSnapshot]:
669670
"""Create a snapshot of the configuration settings.
670671
@@ -707,7 +708,7 @@ async def archive_snapshot(
707708
*,
708709
match_condition: MatchConditions = MatchConditions.Unconditionally,
709710
etag: Optional[str] = None,
710-
**kwargs,
711+
**kwargs: Any,
711712
) -> ConfigurationSnapshot:
712713
"""Archive a configuration setting snapshot. It will update the status of a snapshot from "ready" to "archived".
713714
The retention period will start to count, the snapshot will expire when the entire retention period elapses.
@@ -748,7 +749,7 @@ async def recover_snapshot(
748749
*,
749750
match_condition: MatchConditions = MatchConditions.Unconditionally,
750751
etag: Optional[str] = None,
751-
**kwargs,
752+
**kwargs: Any,
752753
) -> ConfigurationSnapshot:
753754
"""Recover a configuration setting snapshot. It will update the status of a snapshot from "archived" to "ready".
754755
@@ -783,7 +784,7 @@ async def recover_snapshot(
783784

784785
@distributed_trace_async
785786
async def get_snapshot(
786-
self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs
787+
self, name: str, *, fields: Optional[List[Union[str, SnapshotFields]]] = None, **kwargs: Any
787788
) -> ConfigurationSnapshot:
788789
"""Get a configuration setting snapshot.
789790
@@ -808,7 +809,7 @@ def list_snapshots(
808809
name: Optional[str] = None,
809810
fields: Optional[List[Union[str, SnapshotFields]]] = None,
810811
status: Optional[List[Union[str, SnapshotStatus]]] = None,
811-
**kwargs,
812+
**kwargs: Any,
812813
) -> AsyncItemPaged[ConfigurationSnapshot]:
813814
"""List the configuration setting snapshots stored in the configuration service, optionally filtered by
814815
snapshot name, snapshot status and fields to present in return.

0 commit comments

Comments
 (0)