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

Alternative to hashing uuid generation strategy #6

Open
s4ke opened this issue May 14, 2023 · 0 comments
Open

Alternative to hashing uuid generation strategy #6

s4ke opened this issue May 14, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@s4ke
Copy link
Member

s4ke commented May 14, 2023

Currently we only support the rather wasteful pattern of generating canonical ids for DataPoints using this logic:

https://github.com/neuroforgede/nfcompose/blob/main/skipper/skipper/dataseries/storage/uuid.py

def _gen_uuid(data_series_id: Union[uuid.UUID, str], external_id: str) -> str:
    computed_id = hashlib.sha256(external_id.encode('UTF-8')).hexdigest()
    return f'{str(data_series_id)}-{str(computed_id)}'

This is rather wasteful. Changing this without coordination will cause issues, though: Uniqueness inside a dataseries depends on a consistent implementation of this logic. We could however add a configuration setting to the DataSeries that allows for different uuid stategies to be used - e.g. less wasteful hash functions or just the identity function.

While this is not an urgent issue, this is something that could be useful.

@s4ke s4ke added the enhancement New feature or request label May 14, 2023
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

1 participant