manager_dynamo.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:DataFS 作者: ClimateImpactLab 项目源码 文件源码
def _update(self, archive_name, version_metadata):
        '''
        Updates the version specific metadata attribute in DynamoDB
        In DynamoDB this is simply a list append on this attribute value

        Parameters
        ----------
        archive_name: str
            unique '_id' primary key

        version_metadata: dict
            dictionary of version metadata values

        Returns
        -------
        dict
            list of dictionaries of version_history
        '''

        command = "SET version_history = list_append(version_history, :v)"

        self._table.update_item(
            Key={'_id': archive_name},
            UpdateExpression=command,
            ExpressionAttributeValues={':v': [version_metadata]},
            ReturnValues='ALL_NEW')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号