# Dropping dataset from code doesn't properly delete examples

**URL:** <https://support.prodi.gy/t/dropping-dataset-from-code-doesnt-properly-delete-examples/437>\
**Category:** Uncategorized\
**Tags:** done, database\
**Created:** [March 25, 2018, 4:48pm UTC](https://support.prodi.gy/t/dropping-dataset-from-code-doesnt-properly-delete-examples/437 "2018-03-25T16:48:01Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [June 5, 2020, 7:00pm UTC](https://support.prodi.gy/t/dropping-dataset-from-code-doesnt-properly-delete-examples/437/13 "2020-06-05T19:00:25Z")

</div>

Update:

> [@textcat.manual Duplicate Samples](https://support.prodi.gy/t/textcat-manual-duplicate-samples/2962/8):
>
> @cgreco thanks for the confirmation, I think I have a workaround for you. The trouble is that when you use named sessions, it creates the source dataset entries, and another "session" dataset of the form "[dataset\_name]-[session\_id]". So if you used a dataset "foo" and a session "bar" you would end up with examples in the datasets "foo" and "foo-bar". When you drop "foo" it leaves "foo-bar" behind. So in your case, you can work around the problem by dropping the named session datasets in addition to the regular one:
> 
> ```python
> prodigy drop my-dataset
> prodigy drop my-dataset-justin
> 
> ```

> [@textcat.manual Duplicate Samples](https://support.prodi.gy/t/textcat-manual-duplicate-samples/2962/10):
>
> > [@textcat.manual Duplicate Samples](https://support.prodi.gy/t/textcat-manual-duplicate-samples/2962/9):
> >
> > If this is the intended behavior it may be useful to make a note somewhere so that people know they have to clear out the session datasets as well.
> 
> Good point, I'll add a note to the docs for now! We definitely want to have a clearer link between regular datasets and session datasets in the future so Prodigy can automatically remove "orphaned" session datasets – but this may require some changes to the database model.

---

_[View the full topic](https://support.prodi.gy/t/dropping-dataset-from-code-doesnt-properly-delete-examples/437)._
