def update_dynamodb_row()

in workflow1_endpointbuilder/sam-app/functions/function3_processobjectsandupdaterows/index.py [0:0]


def update_dynamodb_row(key, _class, raw_text, datetime_id, bucket_name, dynamodb):
    dynamodb.update_item(
        TableName=f'DatasetCSVTable_{datetime_id}_{bucket_name}_',
        Key={
            'objectKey': {
                'S': key
            }
        },
        ExpressionAttributeNames={
            '#cls': 'class',
            '#txt': 'text',
        },
        ExpressionAttributeValues={
            ':c': {
                'S': _class,
            },
            ':t': {
                'S': raw_text,
            },
        },
        UpdateExpression='SET #cls = :c, #txt = :t'
    )