boto3-assist 0.7.0__py3-none-any.whl → 0.8.0__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.
@@ -308,19 +308,30 @@ class Serialization:
308
308
  )
309
309
  raise
310
310
  except Exception as e: # pylint: disable=w0718
311
- logger.error(
312
- f"Error setting attribute {key} with value {value}: {e}. "
313
- "This usually occurs on properties that don't have setters. "
314
- "You can add a setter (even with a pass action) for this property, "
315
- "decorate it with the @exclude_from_serialization "
316
- "or ignore this error. "
317
- )
311
+ if not Serialization.has_setter(target, key):
312
+ logger.warning(
313
+ f"Error warning attempting to set attribute {key} with value {value}: {e}. "
314
+ "This usually occurs on properties that don't have setters. "
315
+ "You should add a setter (even with a pass action) for this property or "
316
+ "decorate it with the @exclude_from_serialization to avoid this warning."
317
+ )
318
+ else:
319
+ raise e
318
320
 
319
321
  if hasattr(target, "__actively_serializing_data__"):
320
322
  setattr(target, "__actively_serializing_data__", False)
321
323
 
322
324
  return target
323
325
 
326
+ @staticmethod
327
+ def has_setter(obj: object, attr_name: str) -> bool:
328
+ """Check if the given attribute has a setter defined."""
329
+ cls = obj.__class__
330
+ if not hasattr(cls, attr_name):
331
+ return False
332
+ attr = getattr(cls, attr_name, None)
333
+ return isinstance(attr, property) and attr.fset is not None
334
+
324
335
  @staticmethod
325
336
  def has_attribute(obj: object, attribute_name: str) -> bool:
326
337
  """Check if an object has an attribute"""
boto3_assist/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.0'
1
+ __version__ = '0.8.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boto3_assist
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Additional boto3 wrappers to make your life a little easier
5
5
  Author-email: Eric Wilson <boto3-assist@geekcafe.com>
6
6
  License-File: LICENSE-EXPLAINED.txt
@@ -3,7 +3,7 @@ boto3_assist/boto3session.py,sha256=Q9sByNC0r_aMQfHnIEnxtTaiCMUqikm8UeSTxV7-Np0,
3
3
  boto3_assist/connection.py,sha256=CNGkAIRyfrELoWrV0ziQBA3oHacNFuLL3i8faUPRiO0,3486
4
4
  boto3_assist/connection_tracker.py,sha256=UgfR9RlvXf3A4ssMr3gDMpw89ka8mSRvJn4M34SzhbU,4378
5
5
  boto3_assist/http_status_codes.py,sha256=G0zRSWenwavYKETvDF9tNVUXQz3Ae2gXdBETYbjvJe8,3284
6
- boto3_assist/version.py,sha256=09hol5ovL6ArILJIJZ-MiscnOjKa6RjaETmtdgJpW2c,22
6
+ boto3_assist/version.py,sha256=27YY3zFpeaDh6JoC40AqkjBrn68SqFlsWZzjZtw5jwU,22
7
7
  boto3_assist/aws_lambda/event_info.py,sha256=OkZ4WzuGaHEu_T8sB188KBgShAJhZpWASALKRGBOhMg,14648
8
8
  boto3_assist/cloudwatch/cloudwatch_connection.py,sha256=mnGWaLSQpHh5EeY7Ek_2o9JKHJxOELIYtQVMX1IaHn4,2480
9
9
  boto3_assist/cloudwatch/cloudwatch_connection_tracker.py,sha256=mzRtO1uHrcfJNh1XrGEiXdTqxwEP8d1RqJkraMNkgK0,410
@@ -45,10 +45,10 @@ boto3_assist/utilities/file_operations.py,sha256=Zy8fu8fpuVNf7U9NimrLdy5FRF71XSI
45
45
  boto3_assist/utilities/http_utility.py,sha256=koFv7Va-8ng-47Nt1K2Sh7Ti95e62IYs9VMLlGh9Kt4,1173
46
46
  boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  boto3_assist/utilities/numbers_utility.py,sha256=KIiNkBSRbfNWvtXG5SdHp625LTiW12VtADUa4ZlWMFo,8709
48
- boto3_assist/utilities/serialization_utility.py,sha256=KJhit0lI1lr8hhndW6UhKQSZD3c2RH555Ni7eP-e5Ms,16557
48
+ boto3_assist/utilities/serialization_utility.py,sha256=DxVtJ8OPc25LagZxShH4cnXSmrwE8cVUGNTEIkj6stU,17050
49
49
  boto3_assist/utilities/string_utility.py,sha256=5BpDaqGZI8cSM-3YFQLU1fKcWcqG9r1_GPgDstCWFIs,10318
50
- boto3_assist-0.7.0.dist-info/METADATA,sha256=0cBmMT5N4of5YzMQhUlK3S_ovOEaxRItYa_JQnjH16I,1728
51
- boto3_assist-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
52
- boto3_assist-0.7.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
53
- boto3_assist-0.7.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
54
- boto3_assist-0.7.0.dist-info/RECORD,,
50
+ boto3_assist-0.8.0.dist-info/METADATA,sha256=aSgObI42sVUE1by-oebSmnSJqAVpW-QGSsWVQy4oHjY,1728
51
+ boto3_assist-0.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
52
+ boto3_assist-0.8.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
53
+ boto3_assist-0.8.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
54
+ boto3_assist-0.8.0.dist-info/RECORD,,