Skip to content

Commit cb32a37

Browse files
author
Lucas McDonald
committed
reset
1 parent 2b9ee1f commit cb32a37

File tree

9 files changed

+8
-78
lines changed

9 files changed

+8
-78
lines changed

Diff for: DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Initialize generated Dafny
5-
from .internaldafny.generated import module_
5+
from .internaldafny.generated import module_ # noqa: F401
66

77
# Initialize externs
8-
from .internaldafny import extern
8+
from .internaldafny import extern # noqa: F401
99

1010
"""
1111
boto3 uses Python's decimal library to deserialize numbers retrieved by resources
@@ -25,10 +25,10 @@
2525
Other DBESDK DynamoDB runtimes treat "Rounded" as acceptable, but "Inexact" as unacceptable.
2626
By default, boto3 will treat both "Rounded" and "Inexact" as unacceptable.
2727
28-
For DBESDK DynamoDB, change the DynamoDB context to treat "Rounded" as acceptable.
28+
When using DBESDK DynamoDB, change the DynamoDB context to treat "Rounded" as acceptable.
2929
"""
30-
import boto3.dynamodb.types
31-
from decimal import Rounded
30+
import boto3.dynamodb.types # noqa: E402
31+
from decimal import Rounded # noqa: E402
3232

3333
old_context = boto3.dynamodb.types.DYNAMODB_CONTEXT
3434
old_traps = old_context.__getattribute__("traps")

Diff for: DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/encrypted/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
"""High-level helper class to provide an encrypting wrapper for boto3 DynamoDB clients."""
44
import botocore.client
5-
from typing import Optional, Any, Dict, List
5+
from typing import Optional, Any, Dict
66
from copy import deepcopy
77

88
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb_transforms.models import (

Diff for: DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/encrypted/paginator.py

-23
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,22 @@
33
"""High-level helper class to provide an encrypting wrapper for boto3 DynamoDB clients."""
44
from botocore.paginate import (
55
Paginator,
6-
PageIterator,
76
)
87
from copy import deepcopy
9-
import botocore.client
108
from typing import Callable, Optional, Any, Dict
11-
import inspect
129
from typing import Generator
1310

1411
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb_transforms.models import (
15-
GetItemInputTransformInput,
16-
GetItemOutputTransformInput,
17-
PutItemInputTransformInput,
18-
PutItemOutputTransformInput,
19-
BatchWriteItemInputTransformInput,
20-
BatchWriteItemOutputTransformInput,
21-
BatchGetItemInputTransformInput,
22-
BatchGetItemOutputTransformInput,
2312
ScanInputTransformInput,
2413
ScanOutputTransformInput,
25-
TransactGetItemsInputTransformInput,
26-
TransactGetItemsOutputTransformInput,
27-
TransactWriteItemsInputTransformInput,
28-
TransactWriteItemsOutputTransformInput,
2914
QueryInputTransformInput,
3015
QueryOutputTransformInput,
3116
)
32-
from aws_dbesdk_dynamodb.transform import (
33-
dict_to_ddb,
34-
ddb_to_dict,
35-
)
3617
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb_transforms.client import (
3718
DynamoDbEncryptionTransforms
3819
)
3920
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models import (
4021
DynamoDbTablesEncryptionConfig,
41-
DynamoDbTableEncryptionConfig,
42-
)
43-
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb_itemencryptor.config import (
44-
DynamoDbItemEncryptorConfig,
4522
)
4623
from aws_dbesdk_dynamodb.encrypted.boto3_interface import EncryptedBotoInterface
4724
from aws_dbesdk_dynamodb.internal.resource_to_client import ResourceShapeToClientShapeConverter

Diff for: DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/encrypted/resource.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717
from aws_dbesdk_dynamodb.encrypted.table import EncryptedTable
1818
from aws_dbesdk_dynamodb.encrypted.boto3_interface import EncryptedBotoInterface
19-
from typing import Callable, Dict, Any, Optional, Generator
19+
from typing import Callable, Dict, Any, Generator
2020
from copy import deepcopy
2121

2222

Diff for: DynamoDbEncryption/runtimes/python/test/integ/encrypted/test_client.py

-18
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
import pytest
22
import boto3
3-
from decimal import Decimal
4-
from boto3.dynamodb.types import Binary
5-
import time
63
from aws_dbesdk_dynamodb.encrypted.client import EncryptedClient
74
from aws_dbesdk_dynamodb.encrypted.paginator import EncryptedPaginator
8-
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models import (
9-
DynamoDbTablesEncryptionConfig,
10-
)
115
from ...constants import (
126
INTEG_TEST_DEFAULT_TABLE_CONFIGS,
137
INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME,
14-
INTEG_TEST_DEFAULT_ATTRIBUTE_ACTIONS_ON_ENCRYPT,
158
)
169
from ...items import simple_item_ddb, simple_item_dict, complex_item_ddb, complex_item_dict, simple_key_ddb, simple_key_dict, complex_key_ddb, complex_key_dict
1710

@@ -21,39 +14,28 @@
2114

2215
from ...requests import (
2316
basic_put_item_request_ddb,
24-
exhaustive_put_item_request_ddb,
2517
basic_get_item_request_ddb,
26-
exhaustive_get_item_request_ddb,
2718
basic_query_request_ddb,
28-
exhaustive_query_request_ddb,
2919
basic_scan_request_ddb,
30-
exhaustive_scan_request_ddb,
3120
basic_batch_get_item_request_ddb,
3221
basic_batch_write_item_put_request_ddb,
3322
basic_batch_write_item_delete_request_ddb,
3423
basic_transact_write_item_put_request_ddb,
3524
basic_transact_write_item_delete_request_ddb,
36-
basic_transact_write_item_condition_check_request_ddb,
3725
basic_transact_get_item_request_ddb,
3826
)
3927
from ...requests import (
4028
basic_put_item_request_dict,
41-
exhaustive_put_item_request_dict,
4229
basic_get_item_request_dict,
43-
exhaustive_get_item_request_dict,
4430
basic_query_request_dict,
45-
exhaustive_query_request_dict,
4631
basic_scan_request_dict,
47-
exhaustive_scan_request_dict,
4832
basic_batch_get_item_request_dict,
4933
basic_batch_write_item_put_request_dict,
5034
basic_batch_write_item_delete_request_dict,
5135
basic_transact_write_item_put_request_dict,
5236
basic_transact_write_item_delete_request_dict,
53-
basic_transact_write_item_condition_check_request_dict,
5437
basic_transact_get_item_request_dict,
5538
)
56-
from aws_dbesdk_dynamodb.transform import ddb_to_dict
5739

5840
@pytest.fixture(params=[True, False], ids=["standard_dicts", "ddb_json"])
5941
def expect_standard_dictionaries(request):

Diff for: DynamoDbEncryption/runtimes/python/test/integ/encrypted/test_paginator.py

-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
import boto3
2-
from boto3.dynamodb.types import Binary
3-
from decimal import Decimal
42

5-
from aws_cryptographic_material_providers.mpl import AwsCryptographicMaterialProviders
6-
from aws_cryptographic_material_providers.mpl.config import MaterialProvidersConfig
7-
from aws_cryptographic_material_providers.mpl.models import (
8-
CreateAwsKmsMrkKeyringInput,
9-
CreateAwsKmsMrkMultiKeyringInput,
10-
DBEAlgorithmSuiteId,
11-
)
12-
from aws_cryptographic_material_providers.mpl.references import IKeyring
13-
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_structuredencryption.models import (
14-
CryptoAction,
15-
)
16-
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models import (
17-
DynamoDbTableEncryptionConfig,
18-
DynamoDbTablesEncryptionConfig,
19-
)
203
from aws_dbesdk_dynamodb.encrypted.client import (
214
EncryptedClient
225
)

Diff for: DynamoDbEncryption/runtimes/python/test/integ/encrypted/test_table.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
import pytest
22
import boto3
3-
from decimal import Decimal
4-
from boto3.dynamodb.types import Binary
53

64
from aws_dbesdk_dynamodb.encrypted.table import EncryptedTable
7-
from aws_dbesdk_dynamodb.encrypted.paginator import EncryptedPaginator
8-
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models import (
9-
DynamoDbTablesEncryptionConfig,
10-
)
115
from ...constants import (
126
INTEG_TEST_DEFAULT_TABLE_CONFIGS,
137
INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME,
14-
INTEG_TEST_DEFAULT_ATTRIBUTE_ACTIONS_ON_ENCRYPT,
158
)
169
from boto3.dynamodb.types import TypeDeserializer, TypeSerializer
17-
from ...items import simple_item_ddb, simple_item_dict, complex_item_ddb, complex_item_dict
10+
from ...items import simple_item_dict, complex_item_dict
1811
from ...requests import (
1912
basic_put_item_request_dict,
2013
basic_get_item_request_dict,

Diff for: DynamoDbEncryption/runtimes/python/test/requests.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Request constants for DynamoDB operations."""
22

33
from .constants import INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME
4-
from .items import simple_item_ddb, simple_item_dict, complex_item_ddb, complex_item_dict
54
from boto3.dynamodb.conditions import Attr, Key
65

76
# Base request structures that are shared between DDB and dict formats

Diff for: DynamoDbEncryption/runtimes/python/test/unit/encrypted/test_client.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
"""High-level helper class to provide an encrypting wrapper for boto3 DynamoDB clients."""
4-
from botocore.paginate import Paginator
5-
import botocore.client
6-
from typing import Callable, Optional
7-
import inspect
84
import pytest
95
from mock import MagicMock
106
from aws_dbesdk_dynamodb.encrypted.client import (

0 commit comments

Comments
 (0)