boto3-assist 0.2.7__py3-none-any.whl → 0.2.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boto3_assist/dynamodb/dynamodb.py +10 -1
- boto3_assist/dynamodb/dynamodb_model_base.py +11 -1
- boto3_assist/version.py +1 -1
- {boto3_assist-0.2.7.dist-info → boto3_assist-0.2.9.dist-info}/METADATA +1 -1
- {boto3_assist-0.2.7.dist-info → boto3_assist-0.2.9.dist-info}/RECORD +8 -8
- {boto3_assist-0.2.7.dist-info → boto3_assist-0.2.9.dist-info}/WHEEL +0 -0
- {boto3_assist-0.2.7.dist-info → boto3_assist-0.2.9.dist-info}/licenses/LICENSE-EXPLAINED.txt +0 -0
- {boto3_assist-0.2.7.dist-info → boto3_assist-0.2.9.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -82,11 +82,20 @@ class DynamoDB(DynamoDBConnection):
|
|
|
82
82
|
try:
|
|
83
83
|
if not isinstance(item, dict):
|
|
84
84
|
# attemp to convert it
|
|
85
|
+
if not isinstance(item, DynamoDBModelBase):
|
|
86
|
+
raise RuntimeError(
|
|
87
|
+
f"Item is not a dictionary or DynamoDBModelBase. Type: {type(item).__name__}. "
|
|
88
|
+
"In order to prep the model for saving, it needs to already be dictionary or support "
|
|
89
|
+
"the to_resource_dictionary() method, which is available when you inherit from DynamoDBModelBase. "
|
|
90
|
+
"Unable to save item to DynamoDB. The entry was not saved."
|
|
91
|
+
)
|
|
85
92
|
try:
|
|
86
93
|
item = item.to_resource_dictionary()
|
|
87
94
|
except Exception as e: # pylint: disable=w0718
|
|
88
95
|
logger.exception(e)
|
|
89
|
-
raise
|
|
96
|
+
raise RuntimeError(
|
|
97
|
+
"An error occured during model converation. The entry was not saved."
|
|
98
|
+
) from e
|
|
90
99
|
|
|
91
100
|
if isinstance(item, dict):
|
|
92
101
|
self.__log_item_size(item=item)
|
|
@@ -234,9 +234,19 @@ class DynamoDBModelBase:
|
|
|
234
234
|
return value.timestamp()
|
|
235
235
|
|
|
236
236
|
raise ValueError(
|
|
237
|
-
"Value must be a string in a valid datetime format or datetime"
|
|
237
|
+
"Value must be a None, a string in a valid datetime format or datetime"
|
|
238
238
|
)
|
|
239
239
|
|
|
240
|
+
def to_utc(self, value: str | dt.datetime | None) -> dt.datetime | None:
|
|
241
|
+
"""
|
|
242
|
+
Convert a datetime to UTC. This ensures all datetimes are stored in UTC format
|
|
243
|
+
|
|
244
|
+
Exceptions:
|
|
245
|
+
ValueError: If the value is not a datetime string or datetime
|
|
246
|
+
"""
|
|
247
|
+
|
|
248
|
+
value = DatetimeUtility.to_datetime_utc(value)
|
|
249
|
+
|
|
240
250
|
|
|
241
251
|
class DynamoDBSerializer:
|
|
242
252
|
"""Library to Serialize object to a DynamoDB Format"""
|
boto3_assist/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.2.
|
|
1
|
+
__version__ = '0.2.9'
|
|
@@ -2,13 +2,13 @@ boto3_assist/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
boto3_assist/boto3session.py,sha256=NWhWtYR3143thEbTpoklkwdz77-fTMs-QsoQdqfRm6E,6430
|
|
3
3
|
boto3_assist/connection.py,sha256=EJlGueLIYqMSKs7aQlThK1S0Zkb8dOYBWch1iRZdgUI,3233
|
|
4
4
|
boto3_assist/connection_tracker.py,sha256=_s1t7h2DOi3CCIHIr_HIKyGjku65WR-HJ_v8vJHDvO0,2977
|
|
5
|
-
boto3_assist/version.py,sha256=
|
|
5
|
+
boto3_assist/version.py,sha256=bd8hlxKMc0Fh_2w5GWfqBtuwa8uTepTMjT8w7F-EKvY,22
|
|
6
6
|
boto3_assist/cloudwatch/cloudwatch_connection.py,sha256=mnGWaLSQpHh5EeY7Ek_2o9JKHJxOELIYtQVMX1IaHn4,2480
|
|
7
7
|
boto3_assist/cloudwatch/cloudwatch_connection_tracker.py,sha256=mzRtO1uHrcfJNh1XrGEiXdTqxwEP8d1RqJkraMNkgK0,410
|
|
8
8
|
boto3_assist/cloudwatch/cloudwatch_log_connection.py,sha256=qQMZHjUJ6gA8wU9utjQhOURXNSPH2RjxSoAy83bvoCs,1737
|
|
9
9
|
boto3_assist/cloudwatch/cloudwatch_logs.py,sha256=VtI0OnFjX1l4RYVvA8tvveGkPwAogtrplnflZ4dQSNM,1204
|
|
10
10
|
boto3_assist/cloudwatch/cloudwatch_query.py,sha256=uNhSb1Gfp99v8BaHmCnCKs63j4MMU4WveqBavCJyhGY,6409
|
|
11
|
-
boto3_assist/dynamodb/dynamodb.py,sha256=
|
|
11
|
+
boto3_assist/dynamodb/dynamodb.py,sha256=PVWALqf5f8ftsf3U5xcNFo_32HQmysgkNbucMwope4w,15771
|
|
12
12
|
boto3_assist/dynamodb/dynamodb_connection.py,sha256=hr4IGbbEE73fh375tj3_XtYAwwDV0s7z1-6JK_1Tc30,5263
|
|
13
13
|
boto3_assist/dynamodb/dynamodb_connection_tracker.py,sha256=0BWHRfi5_vjkJLuCSX6sYwvA6wc7BSYCQnGrzbhfyKA,404
|
|
14
14
|
boto3_assist/dynamodb/dynamodb_helpers.py,sha256=ajpTJ5bJOm9PDgE2Zx9p2zkTRFV4xswqJRS81SOTn1s,12198
|
|
@@ -16,7 +16,7 @@ boto3_assist/dynamodb/dynamodb_importer.py,sha256=nCKsyRQeMqDSf0Q5mQ_X_oVIg4PRnu
|
|
|
16
16
|
boto3_assist/dynamodb/dynamodb_index.py,sha256=7xa2bN3o8P7XIN9CcJiU7_i1MVjZPl6ZPVZqbZr8pS4,7747
|
|
17
17
|
boto3_assist/dynamodb/dynamodb_iservice.py,sha256=O9Aj0PFEvcuk2vhARifWTFnUwcQW5EXzwZS478Hm-N0,796
|
|
18
18
|
boto3_assist/dynamodb/dynamodb_key.py,sha256=YD7o1EUlwVBQ55p9YCTKqAUU_np4nqtLIHnmp-BeolM,1803
|
|
19
|
-
boto3_assist/dynamodb/dynamodb_model_base.py,sha256=
|
|
19
|
+
boto3_assist/dynamodb/dynamodb_model_base.py,sha256=RpVhh88Bvg0aPO5Ux1yliFc8-INQfWdMsXo3mk_Clw8,15351
|
|
20
20
|
boto3_assist/dynamodb/dynamodb_model_base_interfaces.py,sha256=yT4zDRI8vP15WVOHnCvY3FsEy_QSIta5-bnUby70Xow,747
|
|
21
21
|
boto3_assist/dynamodb/dynamodb_reindexer.py,sha256=bCj6KIU0fQOgjkkiq9yF51PFZZr4Y9Lu3-hPlmsPG0Y,6164
|
|
22
22
|
boto3_assist/dynamodb/dynamodb_reserved_words.py,sha256=p0irNBSqGe4rd2FwWQqbRJWrNr4svdbWiyIXmz9lj4c,1937
|
|
@@ -36,8 +36,8 @@ boto3_assist/utilities/http_utility.py,sha256=koFv7Va-8ng-47Nt1K2Sh7Ti95e62IYs9V
|
|
|
36
36
|
boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
37
|
boto3_assist/utilities/serialization_utility.py,sha256=s_QQRIhtwIE7xN5nU13mNk2wtWyErBX_Sg7n0gbHj-M,4308
|
|
38
38
|
boto3_assist/utilities/string_utility.py,sha256=w8l063UT3GE48tuJopETyZrjG4CgAzWkyDWMAYMg5Og,7432
|
|
39
|
-
boto3_assist-0.2.
|
|
40
|
-
boto3_assist-0.2.
|
|
41
|
-
boto3_assist-0.2.
|
|
42
|
-
boto3_assist-0.2.
|
|
43
|
-
boto3_assist-0.2.
|
|
39
|
+
boto3_assist-0.2.9.dist-info/METADATA,sha256=i463YtqFRnpN9R6CpO4LNt5Esk0EJW9-XW5uLx1riqM,1707
|
|
40
|
+
boto3_assist-0.2.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
41
|
+
boto3_assist-0.2.9.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
|
|
42
|
+
boto3_assist-0.2.9.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
|
|
43
|
+
boto3_assist-0.2.9.dist-info/RECORD,,
|
|
File without changes
|
{boto3_assist-0.2.7.dist-info → boto3_assist-0.2.9.dist-info}/licenses/LICENSE-EXPLAINED.txt
RENAMED
|
File without changes
|
|
File without changes
|