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

Replace import all syntax with explicit import #2003

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

Yicong-Huang
Copy link
Collaborator

@Yicong-Huang Yicong-Huang commented Jun 14, 2023

It is not recommended to use import * statements per PEP 8. It was generally a bad idea to expose the namespace with a wildcard. In our case, pyflakes complains about from pytexera import * and raises a warning in the UI.

This PR uses import pytexera as ptx and the explicit ptx.Tuple, ptx.UDFOperatorV2 variables which is considered a better practice. This change is backward compatible so existing UDFs will not be affected.

Copy link
Collaborator

@aglinxinyuan aglinxinyuan left a comment

Choose a reason for hiding this comment

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

LGTM!

"# \n" +
"# class ProcessTupleOperator(UDFOperatorV2):\n" +
"# \n" +
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here I am adding a new line to fix the warning of single blank line between imports and class definitions.

@Yicong-Huang Yicong-Huang marked this pull request as draft June 14, 2023 07:21
@Yicong-Huang
Copy link
Collaborator Author

After a discussion with @aglinxinyuan, an issue is that pt is colliding with PyTorch's acronym. We need to find a workaround.

@Yicong-Huang Yicong-Huang marked this pull request as ready for review July 28, 2023 09:01
@Yicong-Huang
Copy link
Collaborator Author

discuss this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants