def persist()

in src/rekognition/index-faces/storage.py [0:0]


  def persist(self, face_metadata: FaceMetadata, face_id:str)->None:
    '''
    Writes 
    '''
    assert face_metadata is not None, "faceMetadata not specified"
    assert face_id is not None, "face_id not specified"
    
    try:
      item = self.convert_to_item(face_metadata, face_id)
      self.ddb_client.put_item(TableName= self.face_table_name, Item= item)
    except (
      self.ddb_client.exceptions.ConditionalCheckFailedException,
      self.ddb_client.exceptions.ResourceNotFoundException,
      self.ddb_client.exceptions.ItemCollectionSizeLimitExceededException) as error:
        logger.error(str(error))
        raise NonRecoverableError(error.__class__.__name__)
    except (
      self.ddb_client.exceptions.ProvisionedThroughputExceededException,
      self.ddb_client.exceptions.TransactionConflictException,
      self.ddb_client.exceptions.RequestLimitExceeded,
      self.ddb_client.exceptions.InternalServerError) as error:
        logger.error(str(error))
        raise TransientError(error.__class__.__name__)
    except Exception as error:
        logger.error(str(error))
        raise NotImplementedError(error.__class__.__name__)