You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/04/06 22:47:34 UTC
[GitHub] [spark] itholic commented on a diff in pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
itholic commented on code in PR #36034:
URL: https://github.com/apache/spark/pull/36034#discussion_r844481186
##########
python/pyspark/pandas/__init__.py:
##########
@@ -151,3 +154,13 @@ def _auto_patch_pandas() -> None:
from pyspark.pandas.config import get_option, options, option_context, reset_option, set_option
from pyspark.pandas.namespace import * # noqa: F403
from pyspark.pandas.sql_formatter import sql
+
+
+def __getattr__(key: str) -> Any:
+ if key.startswith("__"):
+ raise AttributeError(key)
+ if hasattr(_MissingPandasLikeGeneralFunctions, key):
+ func = getattr(_MissingPandasLikeGeneralFunctions, key)
+ return partial(func)
Review Comment:
Oh, in this case we don't need to `partial`. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org