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

Use UUID to create unique table names in python binding #1111

Merged
merged 4 commits into from
Oct 14, 2021

Conversation

hippowdon
Copy link
Contributor

Which issue does this PR close?

Closes #1106
Ensure truly unique table names.
uuid crate is included into Cargo.toml

.chain(rand::thread_rng().sample_iter(&Alphanumeric))
.take(10)
.collect::<String>();
let name = "c".to_owned() + &Uuid::new_v4().to_simple().to_string();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you help add unit test? also the to_simple seems to produce upper case string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimexist Thank you for your comment. I have added another commit with two changes - convert UUID table name part to lower case and also I added a test (in Python) to ensure that create_dataframe() registers newly created table and its table name is as expected.
If you are ok with the change, I will squash the commits to clean the branch before the merge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to squash from your end if you prefer not to. We always do squash merge for our PRs anyway.

…at create_dataframe registers new table with expected name
@houqp houqp added the bug Something isn't working label Oct 13, 2021
@houqp
Copy link
Member

houqp commented Oct 13, 2021

@hippowdon looks like there is a linter failure that needs to be addressed.

Copy link
Contributor

@Dandandan Dandandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks.good to me after the lint error is gone 👍

@hippowdon
Copy link
Contributor Author

Apologies that I did not run flake8 before committing Python code. The last commit is clean from flake8'e point of view.

@houqp houqp merged commit 9f9a57d into apache:master Oct 14, 2021
@houqp
Copy link
Member

houqp commented Oct 14, 2021

Thanks @hippowdon for the quick fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use UUID to create random table names in python binding
4 participants