Skip to content

Commit 28b3a45

Browse files
authored
Do not pass BillingMode: ‘PROVISIONED’ to CreateTable (#721)
1 parent dc4b72e commit 28b3a45

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

pynamodb/connection/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
TRANSACT_GET, TRANSACT_PUT, TRANSACT_DELETE, TRANSACT_UPDATE, UPDATE_EXPRESSION,
4646
RETURN_VALUES_ON_CONDITION_FAILURE_VALUES, RETURN_VALUES_ON_CONDITION_FAILURE,
4747
AVAILABLE_BILLING_MODES, DEFAULT_BILLING_MODE, BILLING_MODE, PAY_PER_REQUEST_BILLING_MODE,
48+
PROVISIONED_BILLING_MODE,
4849
TIME_TO_LIVE_SPECIFICATION, ENABLED, UPDATE_TIME_TO_LIVE
4950
)
5051
from pynamodb.exceptions import (
@@ -588,6 +589,8 @@ def create_table(self,
588589
raise ValueError("incorrect value for billing_mode, available modes: {}".format(AVAILABLE_BILLING_MODES))
589590
if billing_mode == PAY_PER_REQUEST_BILLING_MODE:
590591
del operation_kwargs[PROVISIONED_THROUGHPUT]
592+
elif billing_mode == PROVISIONED_BILLING_MODE:
593+
del operation_kwargs[BILLING_MODE]
591594

592595
if global_secondary_indexes:
593596
global_secondary_indexes_list = []

tests/test_base_connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ def test_create_table(self):
145145
]
146146
params = {
147147
'TableName': 'ci-table',
148-
'BillingMode': PROVISIONED_BILLING_MODE,
149148
'ProvisionedThroughput': {
150149
'WriteCapacityUnits': 1,
151150
'ReadCapacityUnits': 1

tests/test_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@ def fake_wait(*obj, **kwargs):
607607
'ReadCapacityUnits': 25, 'WriteCapacityUnits': 25
608608
},
609609
'TableName': 'UserModel',
610-
'BillingMode': 'PROVISIONED'
611610
}
612611
actual = req.call_args_list[1][0][1]
613612
self.assertEqual(sorted(actual.keys()), sorted(params.keys()))

tests/test_table_connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def test_create_table(self):
9191
]
9292
params = {
9393
'TableName': 'ci-table',
94-
'BillingMode': PROVISIONED_BILLING_MODE,
9594
'ProvisionedThroughput': {
9695
'WriteCapacityUnits': 1,
9796
'ReadCapacityUnits': 1

0 commit comments

Comments
 (0)