def version_from_material_description()

in src/dynamodb_encryption_sdk/material_providers/store/meta.py [0:0]


    def version_from_material_description(self, material_description):
        # (Dict[Text, Text]) -> int
        """Determine the version from the provided material description.

        :param dict material_description: Material description to use with this request
        :returns: version to use
        :rtype: int
        """
        try:
            info = material_description[_MATERIAL_DESCRIPTION_META_FIELD]
        except KeyError:
            raise Exception("No info found")

        try:
            return int(info.split("#", 1)[1])
        except (IndexError, ValueError):
            raise Exception("Malformed info")