man-group / arctic

High performance datastore for time series and tick data
https://arctic.readthedocs.io/en/latest/
GNU Lesser General Public License v2.1
3.05k stars 583 forks source link

Delete individual versions with Version Store #866

Closed tomnewg closed 4 years ago

tomnewg commented 4 years ago

Hi guys,

is it possible to delete individual versions with Version Store? Looking into the docs and trying a few things I was only able to delete all versions for a corresponding ticker. In my use case, I upload data as new version but I would like to keep for example the last 6 versions. So far I either only keep the last 1-2 with prune=True or I keep all the version with prune = False, both are not ideal for me.

Thanks for your help in advance and thank you so much for creating this awesome tool.

Tom

shashank88 commented 4 years ago

There is a ._delete_version method in the library that you can use for this: https://github.com/man-group/arctic/blob/master/arctic/store/version_store.py#L901

shashank88 commented 4 years ago

It's hidden intentionally though as iirc it had some issues when you were appending which deduped blocks and then ended up deleting the base version. It should be fine if you are not.

tomnewg commented 4 years ago

awesome thanks @shashank88. I will test this.