{"record":{"id":"065fa202776e8172","repo":"boto/boto3","slug":"dynamodb-type-dynamodb-type-is-not-supported","errorCode":null,"errorMessage":"Dynamodb type {dynamodb_type} is not supported","messagePattern":"Dynamodb type (.+?) is not supported","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"boto3/dynamodb/types.py","lineNumber":279,"sourceCode":"            {'BS': [bytes]}                         set([bytes])\n            {'L': list}                             list\n            {'M': dict}                             dict\n\n        :returns: The pythonic value of the DynamoDB type.\n        \"\"\"\n\n        if not value:\n            raise TypeError(\n                'Value must be a nonempty dictionary whose key '\n                'is a valid dynamodb type.'\n            )\n        dynamodb_type = list(value.keys())[0]\n        try:\n            deserializer = getattr(\n                self, f'_deserialize_{dynamodb_type}'.lower()\n            )\n        except AttributeError:\n            raise TypeError(f'Dynamodb type {dynamodb_type} is not supported')\n        return deserializer(value[dynamodb_type])\n\n    def _deserialize_null(self, value):\n        return None\n\n    def _deserialize_bool(self, value):\n        return value\n\n    def _deserialize_n(self, value):\n        return DYNAMODB_CONTEXT.create_decimal(value)\n\n    def _deserialize_s(self, value):\n        return value\n\n    def _deserialize_b(self, value):\n        return Binary(value)\n\n    def _deserialize_ns(self, value):","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/boto/boto3/blob/6e10b029c1326a437932a8b24f38af69fd986e15/boto3/dynamodb/types.py#L261-L297","documentation":"TypeDeserializer uses getattr(self, f'_deserialize_{type}'.lower()) to find a deserializer for each DynamoDB type tag (null, bool, n, s, b, ns, ss, bs, l, m). If the type tag is not one of those, AttributeError is caught and re-raised as TypeError('Dynamodb type {type} is not supported'). This handles malformed or future/unknown type tags.","triggerScenarios":"Passing {'X': 'foo'}, {'Number': 1} (wrong casing), or any attribute value whose single key is not a recognized DynamoDB type tag.","commonSituations":"Hand-building low-level item dicts; consuming data from a source that uses non-standard type tags; case mismatch from incorrectly upper/lower-casing keys.","solutions":["Use only canonical type tags: S, N, B, SS, NS, BS, BOOL, NULL, L, M.","Validate the type tag against the known set before deserializing.","When building low-level items, prefer the high-level resource API which serializes for you."],"exampleFix":"# before\nd.deserialize({'Number': '42'})  # wrong tag\n# after\nd.deserialize({'N': '42'})","handlingStrategy":"validation","validationCode":"VALID = {'S','N','B','SS','NS','BS','BOOL','NULL','L','M'}\ndef safe_deserialize(d, TypeDeserializer):\n    key = next(iter(d), None)\n    assert key in VALID, f'Unsupported dynamodb type: {key}'\n    return TypeDeserializer().deserialize(d)","typeGuard":"VALID = {'S','N','B','SS','NS','BS','BOOL','NULL','L','M'}\ndef has_valid_type_tag(v) -> bool:\n    return isinstance(v, dict) and len(v) == 1 and next(iter(v)) in VALID","tryCatchPattern":"from boto3.dynamodb.types import TypeDeserializer\nd = TypeDeserializer()\ntry:\n    val = d.deserialize(raw)\nexcept TypeError as e:\n    # log and skip malformed attribute\n    val = None","preventionTips":["Use only canonical DynamoDB type tags.","Validate tags against the known set before deserializing.","Avoid hand-building low-level attribute dicts."],"tags":["dynamodb","types","deserialization","boto3"],"backgroundTag":null,"analyzedSha":"6e10b029c1326a437932a8b24f38af69fd986e15","analyzedAt":"2026-08-11T20:52:47.213Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}