Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.
This repository was archived by the owner on May 6, 2024. It is now read-only.

Incorrect syntax in db.delete_dataset #356

@BartekCupial

Description

@BartekCupial

🐛 Bug

Incorrect syntax in db.delete_dataset.

To Reproduce

Steps to reproduce the behavior:

    db.create(dbfilename)
    populate_db.add_nledata_directory(dataset_path, dataset_name, dbfilename)

    with db.db(filename=dbfilename, rw=True) as conn:
        db.delete_dataset(dataset_name, conn)

Fix proposition

Changing lines 165-166 in https://github.com/facebookresearch/nle/blob/main/nle/dataset/db.py

        conn.execute("DELETE datasets WHERE dataset_name=?", (dataset_name,))
        conn.execute("DELETE roots WHERE dataset_name=?", (dataset_name,))

to

        conn.execute("DELETE FROM datasets WHERE dataset_name=?", (dataset_name,))
        conn.execute("DELETE FROM roots WHERE dataset_name=?", (dataset_name,))     

should fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions