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

Incorrect syntax in db.delete_dataset #356

Open
BartekCupial opened this issue May 9, 2023 · 0 comments
Open

Incorrect syntax in db.delete_dataset #356

BartekCupial opened this issue May 9, 2023 · 0 comments

Comments

@BartekCupial
Copy link

🐛 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant