Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to restrict versions of a symbol to only the previous and latest one. #1628

Closed
philsv opened this issue Jun 18, 2024 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@philsv
Copy link

philsv commented Jun 18, 2024

Is your feature request related to a problem? Please describe.
For my usecase I really only want maximum 2 versions of a symbol saved in a library.

I tried prune_previous_version=True but still on some symbols data I do have 90+ versions which I really don't need.
Since I started using articdb I have always appended my data, which I guess will always create a new version?
Should I use update instead, will this solve my problem? I can't find reliable information in the docs or in the code.

Describe the solution you'd like
Where I can use something like that:

library.append(symbol, keep_latest_versions=2)
library.update(symbol, prune_previous_versions=True)

And it reliably only holds the previous version and the latest version, and removes any other versions related to the symbol.

Describe alternatives you've considered

Additional context
Is there another way to achieve that or simular results?

@philsv philsv added the enhancement New feature or request label Jun 18, 2024
@jamesmunro
Copy link
Collaborator

jamesmunro commented Jul 1, 2024

Hi,

I expect you are seeing that prune_previous_versions wasn't behaving as expected on append and update. We have a proposed fix in PR: https://github.com/man-group/ArcticDB/pull/1640/files, so that it will actually remove previous versions.

Would this solve your use case? Or you would like further flexibility like this as well?

@philsv
Copy link
Author

philsv commented Jul 1, 2024

Hi @jamesmunro,

that would be amazing if prune_previous_version works on both append and update.

So if I understand this correctly this:
Removes previous (non-snapshotted) versions from the database.

will remove all versions except for the latest symbol version (latest timestamp) by applying prune_previous_version if this PR gets merged?
If so, yes this would be enough for my use case.

@jamesmunro
Copy link
Collaborator

Yes, that's exactly right. We're definitely proceeding with this fix so I'll close this request. Please note that the first run with the new version (detail will be in the release notes) may run slower as it does an initial prune.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants