Skip to content

Commit 635924c

Browse files
committed
linting fixes
1 parent 6515bbf commit 635924c

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

src/dynamodb_encryption_sdk/encrypted/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __attrs_post_init__(self):
5050
# type: () -> None
5151
"""Make sure that primary index attributes are not being encrypted."""
5252
if self.encryption_context.partition_key_name is not None:
53-
if self.attribute_actions.action(self.encryption_context.partition_key_name) is CryptoAction.ENCRYPT_AND_SIGN:
53+
if self.attribute_actions.action(self.encryption_context.partition_key_name) is CryptoAction.ENCRYPT_AND_SIGN: # noqa pylint: disable=line-too-long
5454
raise InvalidArgumentError('Cannot encrypt partition key')
5555

5656
if self.encryption_context.sort_key_name is not None:

src/dynamodb_encryption_sdk/encrypted/client.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ class EncryptedClient(object):
146146
def __attrs_post_init__(self):
147147
"""Set up the table info cache and translation methods."""
148148
if self._expect_standard_dictionaries:
149-
self._encrypt_item = encrypt_python_item
150-
self._decrypt_item = decrypt_python_item
149+
self._encrypt_item = encrypt_python_item # attrs confuses pylint: disable=attribute-defined-outside-init
150+
self._decrypt_item = decrypt_python_item # attrs confuses pylint: disable=attribute-defined-outside-init
151151
else:
152-
self._encrypt_item = encrypt_dynamodb_item
153-
self._decrypt_item = decrypt_dynamodb_item
152+
self._encrypt_item = encrypt_dynamodb_item # attrs confuses pylint: disable=attribute-defined-outside-init
153+
self._decrypt_item = decrypt_dynamodb_item # attrs confuses pylint: disable=attribute-defined-outside-init
154154
self._table_info_cache = TableInfoCache( # attrs confuses pylint: disable=attribute-defined-outside-init
155155
client=self._client,
156156
auto_refresh_table_indexes=self._auto_refresh_table_indexes
@@ -217,7 +217,13 @@ def update_item(self, **kwargs):
217217
raise NotImplementedError('"update_item" is not yet implemented')
218218

219219
def get_paginator(self, operation_name):
220-
""""""
220+
"""Get a paginator from the underlying client. If the paginator requested is for
221+
"scan" or "query", the paginator returned will transparently decrypt the returned items.
222+
223+
:param str operation_name: Name of operation for which to get paginator
224+
:returns: Paginator for name
225+
:rtype: Paginator or EncryptedPaginator
226+
"""
221227
paginator = self._client.get_paginator(operation_name)
222228

223229
if operation_name in ('scan', 'query'):

src/dynamodb_encryption_sdk/encrypted/item.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def encrypt_dynamodb_item(item, crypto_config):
7272
encrypted_item = item.copy()
7373
else:
7474
# Add the attribute encryption mode to the inner material description
75-
# TODO: This is awkward...see if we can break this out any
7675
encryption_mode = MaterialDescriptionValues.CBC_PKCS5_ATTRIBUTE_ENCRYPTION.value
7776
inner_material_description[
7877
MaterialDescriptionKeys.ATTRIBUTE_ENCRYPTION_MODE.value

src/pylintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[MESSAGES CONTROL]
2+
# Disabling messages that we either don't care about
3+
# for tests or are necessary to break for tests.
4+
#
5+
# R0801 : duplicate-code (causes lots of problems with implementations of common interfaces)
6+
disable = R0801
7+
18
[BASIC]
29
# Allow function names up to 50 characters
310
function-rgx = [a-z_][a-z0-9_]{2,50}$

0 commit comments

Comments
 (0)