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

[SPARK-44107][CONNECT][PYTHON] Hide unsupported Column methods from auto-completion #41675

Closed
wants to merge 1 commit into from

Conversation

zhengruifeng
Copy link
Contributor

@zhengruifeng zhengruifeng commented Jun 20, 2023

What changes were proposed in this pull request?

Hide unsupported Column method _jc from auto-completion, it is already handled in __getattr__, see

def __getattr__(self, item: Any) -> "Column":
if item == "_jc":
raise PySparkAttributeError(
error_class="JVM_ATTRIBUTE_NOT_SUPPORTED", message_parameters={"attr_name": "_jc"}
)
if item.startswith("__"):
raise PySparkAttributeError(
error_class="ATTRIBUTE_NOT_SUPPORTED", message_parameters={"attr_name": item}
)
return self[item]

Why are the changes needed?

no need to show unsupported methods

Does this PR introduce any user-facing change?

yes

before this PR:
Screenshot 2023-06-20 at 21 38 23

after this PR:
Screenshot 2023-06-20 at 21 39 42

How was this patch tested?

existing UTs and manually check in ipython

@zhengruifeng
Copy link
Contributor Author

merged to master, thank you @ueshin @HyukjinKwon

@zhengruifeng zhengruifeng deleted the connect_col_hide branch June 21, 2023 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants