Skip to content

Adding a DELETE end point for dataset level tags #2692

@davidsharp7

Description

@davidsharp7

Current tags are added to a dataset via the end point

POST http://localhost:5000/api/v1/namespaces/{namespace}/datasets/{dataset}/tags/{tag}

In the background this updates

datasets_tag_mapping

with the dataset_uuid and the tag_uuid. The UI then returns any tags attached to a given dataset

It would be useful to have a DELETE end point to remove that linkage. Simplest approach would be to just delete the linkage with the following query.

so

DELETE http://localhost:5000/api/v1/namespaces/{namespace}/datasets/{dataset}/tags/{tag}

would run

DELETE FROM datasets_tag_mapping dtm
        WHERE EXISTS (
            SELECT 1
            FROM datasets d
            JOIN tags t ON d.uuid = dtm.dataset_uuid AND t.uuid = dtm.tag_uuid
            WHERE d.name = :datasetName AND t.name = :tagName
        );

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions