# How can you overwrite a split? + Possible Bug

**URL:** <https://discuss.huggingface.co/t/how-can-you-overwrite-a-split-possible-bug/52707>\
**Category:** 🤗Datasets\
**Created:** [August 29, 2023, 6:42pm UTC](https://discuss.huggingface.co/t/how-can-you-overwrite-a-split-possible-bug/52707 "2023-08-29T18:42:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![govindrai](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/govindrai/32/18781_2.png) [@govindrai](https://discuss.huggingface.co/u/govindrai)\
**Post date:** [August 29, 2023, 6:42pm UTC](https://discuss.huggingface.co/t/how-can-you-overwrite-a-split-possible-bug/52707/1 "2023-08-29T18:42:26Z")

</div>

**Goal**  
I want to be able to overwrite a split in my dataset. Is there a way to do so?

**Current Behavior**  
When I push to an existing split I get this error:

```auto
ValueError: Split complexRoofLocation_01Apr2023_to_31May2023test already present

```

Is there a way to remove a split, without manually going into the dataset?

**Potential Bug**  
What’s strange is that datasets, despite the operation erroring out form the ValueError above, still overwrites the split:

```auto
Pushing dataset shards to the dataset hub: 100% [.....................] 1/1 [00:00<00:00, 55.04it/s]

```

This makes you feel like the whole operation failed, but in fact your dataset is now changed. That feels like a bug.

**Additional Strange Behavior**  
While it updates the split, it doesn’t update the split’s information. Because of this when you pull down the dataset you may end up getting a `NonMatchingSplitsSizesError`. I do because my the original split had 5 rows, but upon attempting to override there were only 4. So the dataset states there’s 5 but only 4 exist in the split.

**Expected Behavior**  
This basically corrupts the data. Either it should let the overwrite happen or it shouldn’t do anything.

Appreciate you taking the time to read this!

---

<div class="post-metadata">

**Author:** ![polinaeterna](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/polinaeterna/32/19055_2.png) [@polinaeterna](https://discuss.huggingface.co/u/polinaeterna)\
**Post date:** [August 31, 2023, 1:05pm UTC](https://discuss.huggingface.co/t/how-can-you-overwrite-a-split-possible-bug/52707/2 "2023-08-31T13:05:21Z")

</div>

hi @govindrai ! could you please provide a short code snippet to reproduce this behavior and which version of `datasets` you use?  
also feel free to [open an issue](https://github.com/huggingface/datasets/issues/new/choose) with these bugs and how to reproduce them on GitHub 🙂

---

<div class="post-metadata">

**Author:** ![govindrai](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/govindrai/32/18781_2.png) [@govindrai](https://discuss.huggingface.co/u/govindrai)\
**Post date:** [October 1, 2023, 12:54am UTC](https://discuss.huggingface.co/t/how-can-you-overwrite-a-split-possible-bug/52707/3 "2023-10-01T00:54:27Z")

</div>

Thanks! Opened [bug](https://github.com/huggingface/datasets/issues/6271) report. Colab link in bug report!
