Skip to content

Commit 9c714ab

Browse files
committed
refactor(store): use get_configuration over get_json_configuration
1 parent f63a5da commit 9c714ab

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

aws_lambda_powertools/utilities/feature_flags/appconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
self.jmespath_options = jmespath_options
5555
self._conf_store = AppConfigProvider(environment=environment, application=application, config=config)
5656

57-
def get_json_configuration(self) -> Dict[str, Any]:
57+
def get_configuration(self) -> Dict[str, Any]:
5858
"""Get configuration string from AWS AppConfig and return the parsed JSON dictionary
5959
6060
Raises

aws_lambda_powertools/utilities/feature_flags/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class StoreProvider(ABC):
66
@abstractmethod
7-
def get_json_configuration(self) -> Dict[str, Any]:
7+
def get_configuration(self) -> Dict[str, Any]:
88
"""Get configuration string from any configuration storing application and return the parsed JSON dictionary
99
1010
Raises

aws_lambda_powertools/utilities/feature_flags/feature_flags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def get_configuration(self) -> Union[Dict[str, Dict], Dict]:
116116
}
117117
"""
118118
# parse result conf as JSON, keep in cache for self.max_age seconds
119-
config = self._store.get_json_configuration()
119+
config = self._store.get_configuration()
120120

121121
validator = schema.SchemaValidator(schema=config)
122122
validator.validate()

tests/functional/feature_toggles/test_feature_toggles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ def test_app_config_get_parameter_err(mocker, config):
415415
# GIVEN an appconfig with a missing config
416416
app_conf_fetcher = init_fetcher_side_effect(mocker, config, GetParameterError())
417417

418-
# WHEN calling get_json_configuration
418+
# WHEN calling get_configuration
419419
with pytest.raises(ConfigurationError) as err:
420-
app_conf_fetcher.get_json_configuration()
420+
app_conf_fetcher.get_configuration()
421421

422422
# THEN raise ConfigurationError error
423423
assert "AWS AppConfig configuration" in str(err.value)

0 commit comments

Comments
 (0)