How to delete a session from python code

I am trying to delete a session from python code. I see two functions called trash_session and trash_sessions but somehow calling them return a PermissionError:

The process cannot access the file because it is being used by another process

Is there any API to remove a session similar to drop_dataset or drop_example?


Hi! As far as I know, the trash methods are only internals for Prodigy Teams and not currently used in Prodigy itself. Under the hood, a session dataset is just a regular dataset – so if you have a dataset my_dataset and a session oliver, the session dataset is my_dataset-oliver and you should be able to just run prodigy drop my_dataset-oliver, or db.drop_dataset("my_dataset-oliver").