Skip to content

Commit e207aec

Browse files
authored
Fixes copy issue (#34615)
1 parent 180b4a7 commit e207aec

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

sdk/appconfiguration/azure-appconfiguration-provider/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
### Bugs Fixed
1414

15+
* Fixes issue where loading configurations were slower do to returning a copy of the configurations.
16+
1517
### Other Changes
1618

1719
## 1.1.0 (2024-01-29)

sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/_azureappconfigurationprovider.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# -------------------------------------------------------------------------
6-
import copy
76
import os
87
import json
98
import random
@@ -690,7 +689,7 @@ def keys(self) -> KeysView[str]:
690689
:rtype: KeysView[str]
691690
"""
692691
with self._update_lock:
693-
return copy.deepcopy(self._dict).keys()
692+
return self._dict.keys()
694693

695694
def items(self) -> ItemsView[str, Union[str, Mapping[str, Any]]]:
696695
"""
@@ -701,7 +700,7 @@ def items(self) -> ItemsView[str, Union[str, Mapping[str, Any]]]:
701700
:rtype: ItemsView[str, Union[str, Mapping[str, Any]]]
702701
"""
703702
with self._update_lock:
704-
return copy.deepcopy(self._dict).items()
703+
return self._dict.items()
705704

706705
def values(self) -> ValuesView[Union[str, Mapping[str, Any]]]:
707706
"""
@@ -713,7 +712,7 @@ def values(self) -> ValuesView[Union[str, Mapping[str, Any]]]:
713712
:rtype: ValuesView[Union[str, Mapping[str, Any]]]
714713
"""
715714
with self._update_lock:
716-
return copy.deepcopy((self._dict)).values()
715+
return (self._dict).values()
717716

718717
@overload
719718
def get(self, key: str, default: None = None) -> Union[str, JSON, None]:
@@ -734,7 +733,7 @@ def get(self, key: str, default: Optional[Union[str, JSON, _T]] = None) -> Union
734733
:rtype: Union[str, JSON]
735734
"""
736735
with self._update_lock:
737-
return copy.deepcopy(self._dict).get(key, default)
736+
return self._dict.get(key, default)
738737

739738
def __eq__(self, other: Any) -> bool:
740739
if not isinstance(other, AzureAppConfigurationProvider):

sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/aio/_azureappconfigurationproviderasync.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# license information.
55
# -------------------------------------------------------------------------
66
import json
7-
import copy
87
from threading import Lock
98
import datetime
109
import logging
@@ -583,7 +582,7 @@ def keys(self) -> KeysView[str]:
583582
:return: A list of keys loaded from Azure App Configuration.
584583
:rtype: KeysView[str]
585584
"""
586-
return copy.deepcopy(self._dict).keys()
585+
return self._dict.keys()
587586

588587
def items(self) -> ItemsView[str, Union[str, Mapping[str, Any]]]:
589588
"""
@@ -593,7 +592,7 @@ def items(self) -> ItemsView[str, Union[str, Mapping[str, Any]]]:
593592
:return: A set-like object of key-value pairs loaded from Azure App Configuration.
594593
:rtype: ItemsView[str, Union[str, Mapping[str, Any]]]
595594
"""
596-
return copy.deepcopy(self._dict).items()
595+
return self._dict.items()
597596

598597
def values(self) -> ValuesView[Union[str, Mapping[str, Any]]]:
599598
"""
@@ -604,7 +603,7 @@ def values(self) -> ValuesView[Union[str, Mapping[str, Any]]]:
604603
based on there content type.
605604
:rtype: ValuesView[Union[str, Mapping[str, Any]]]
606605
"""
607-
return copy.deepcopy(self._dict).values()
606+
return self._dict.values()
608607

609608
@overload
610609
def get(self, key: str, default: None = None) -> Union[str, JSON, None]:
@@ -624,7 +623,7 @@ def get(self, key: str, default: Optional[Union[str, JSON, _T]] = None) -> Union
624623
:return: The value of the specified key.
625624
:rtype: Union[str, JSON]
626625
"""
627-
return copy.deepcopy(self._dict).get(key, default)
626+
return self._dict.get(key, default)
628627

629628
def __eq__(self, other: Any) -> bool:
630629
if not isinstance(other, AzureAppConfigurationProvider):

0 commit comments

Comments
 (0)