Skip to content

Commit c92bde6

Browse files
chore(deps-dev): bump flake8-bugbear from 22.1.11 to 22.4.25 (#1156)
* chore(deps-dev): bump flake8-bugbear from 22.1.11 to 22.4.25 Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 22.1.11 to 22.4.25. - [Release notes](https://github.com/PyCQA/flake8-bugbear/releases) - [Commits](PyCQA/flake8-bugbear@22.1.11...22.4.25) --- updated-dependencies: - dependency-name: flake8-bugbear dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix: change static_pk_value to optional and default of None Flake correctly pointed out that using a dyanmic string will cause issues in an arg. The arg was changed to `Optional[str] = None` instead and a check for `None` is now done, if set to `None`, the old value is used: `idempotency<NAME>` is used, where name is from a env var Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Simon Thulbourn <[email protected]>
1 parent 4ff4f54 commit c92bde6

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Diff for: aws_lambda_powertools/utilities/idempotency/persistence/dynamodb.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222
self,
2323
table_name: str,
2424
key_attr: str = "id",
25-
static_pk_value: str = f"idempotency#{os.getenv(constants.LAMBDA_FUNCTION_NAME_ENV, '')}",
25+
static_pk_value: Optional[str] = None,
2626
sort_key_attr: Optional[str] = None,
2727
expiry_attr: str = "expiration",
2828
status_attr: str = "status",
@@ -76,6 +76,9 @@ def __init__(
7676
if sort_key_attr == key_attr:
7777
raise ValueError(f"key_attr [{key_attr}] and sort_key_attr [{sort_key_attr}] cannot be the same!")
7878

79+
if static_pk_value is None:
80+
static_pk_value = f"idempotency#{os.getenv(constants.LAMBDA_FUNCTION_NAME_ENV, '')}"
81+
7982
self._table = None
8083
self.table_name = table_name
8184
self.key_attr = key_attr

Diff for: poetry.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bandit = "^1.7.1"
5050
radon = "^5.1.0"
5151
xenon = "^0.9.0"
5252
flake8-eradicate = "^1.2.1"
53-
flake8-bugbear = "^22.1.11"
53+
flake8-bugbear = "^22.4.25"
5454
mkdocs-git-revision-date-plugin = "^0.3.2"
5555
mike = "^0.6.0"
5656
mypy = "^0.950"

0 commit comments

Comments
 (0)