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

Remove randomness from AstroDB.create_unique_table_name() #32

Closed
AustinCullar opened this issue Sep 29, 2024 · 0 comments · Fixed by #39
Closed

Remove randomness from AstroDB.create_unique_table_name() #32

AustinCullar opened this issue Sep 29, 2024 · 0 comments · Fixed by #39
Assignees
Labels
enhancement New feature or request

Comments

@AustinCullar
Copy link
Owner

AustinCullar commented Sep 29, 2024

I don't like that the AstroDB.create_unique_table_name() method generates random strings and hopes that they are unique, regardless of how unlikely collisions might be (1 in 26^12 for a 12 character string of capital letters).

I believe I can modify this method to work a bit like an odometer. I'd like to use 10 character strings of capital letters, but roll the string forward with each additional comment table name generated. For example:

Comment table 1: AAAAAAAAAA
Comment table 2: BAAAAAAAAA
Comment table 3: CAAAAAAAAA
...

This would provide a large set of possible table names (26^10) while removing the uncertainty involved with random string generation.

This will also require updating the tests in tests/test_astro_db.py.

@AustinCullar AustinCullar self-assigned this Sep 29, 2024
@AustinCullar AustinCullar added the enhancement New feature or request label Sep 29, 2024
@AustinCullar AustinCullar linked a pull request Oct 1, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant