Skip to content

Commit 656876b

Browse files
committed
Handle VersionLabel missing from API response gracefully
1 parent 7e28975 commit 656876b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## 2.2.1 - 2025-01-08
11+
12+
- Handle `VersionLabel` not being present in API response gracefully
13+
1014
## 2.2.0 - 2024-11-26
1115

1216
### Added

appconfig_helper/appconfig_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import json
66
import time
7-
from typing import Any, Dict, Optional, Union
7+
from typing import Any, Dict, Optional, Union, cast
88

99
import boto3
1010
import botocore
@@ -196,5 +196,5 @@ def update_config(self, force_update: bool = False) -> bool:
196196
self._last_update_time = time.time()
197197
self._raw_config = content
198198
self._content_type = response["ContentType"]
199-
self._version_label = response["VersionLabel"]
199+
self._version_label = cast(Optional[str], response.get("VersionLabel"))
200200
return True

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "sample-helper-aws-appconfig"
3-
version = "2.2.0"
3+
version = "2.2.1"
44
description = "Sample helper library for AWS AppConfig"
55
authors = ["Amazon Web Services"]
66
maintainers = ["James Seward <sewardjm@amazon.co.uk>"]

0 commit comments

Comments
 (0)