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/01 04:19:45 UTC
[GitHub] [spark] itholic opened a new pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
itholic opened a new pull request #36034:
URL: https://github.com/apache/spark/pull/36034
### What changes were proposed in this pull request?
This PR proposes to add `python/pyspark/pandas/missing/general_functions.py` to track the missing pandas general functions API.
### Why are the changes needed?
We have `missing` directory to track & address the missing pandas APIs, but one for general functions is missing.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
The existing tests should cover
--
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
[GitHub] [spark] itholic commented on a change in pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
Posted by GitBox <gi...@apache.org>.
itholic commented on a change in pull request #36034:
URL: https://github.com/apache/spark/pull/36034#discussion_r840218570
##########
File path: python/docs/source/reference/pyspark.pandas/general_functions.rst
##########
@@ -41,6 +41,7 @@ Data manipulations and SQL
melt
merge
+ merge_asof
Review comment:
We added this from https://github.com/apache/spark/pull/34053, but missing in our doc so far.
--
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
[GitHub] [spark] HyukjinKwon commented on a change in pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #36034:
URL: https://github.com/apache/spark/pull/36034#discussion_r840221111
##########
File path: python/pyspark/pandas/missing/general_functions.py
##########
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+from pyspark.pandas.missing import unsupported_function
+
+
+def _unsupported_function(method_name, deprecated=False, reason=""):
+ return unsupported_function(
+ class_name="pd", method_name=method_name, deprecated=deprecated, reason=reason
+ )
+
+
+class _MissingPandasLikeGeneralFunctions:
+
+ pivot = _unsupported_function("pivot")
+ pivot_table = _unsupported_function("pivot_table")
+ crosstab = _unsupported_function("crosstab")
+ cut = _unsupported_function("cut")
+ qcut = _unsupported_function("qcut")
+ merge_ordered = _unsupported_function("merge_ordered")
+ factorize = _unsupported_function("factorize")
+ unique = _unsupported_function("unique")
+ wide_to_long = _unsupported_function("wide_to_long")
+ bdate_range = _unsupported_function("bdate_range")
+ period_range = _unsupported_function("period_range")
+ infer_freq = _unsupported_function("infer_freq")
+ interval_range = _unsupported_function("interval_range")
+ eval = _unsupported_function("eval")
Review comment:
Shall we add a test for this too? e.g.) https://github.com/apache/spark/blob/942ab78ee1bdfbc3fa10701fcf2d0e30569c8ab4/python/pyspark/pandas/tests/test_dataframe.py#L1859 as an example
--
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
[GitHub] [spark] HyukjinKwon commented on a change in pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #36034:
URL: https://github.com/apache/spark/pull/36034#discussion_r840374038
##########
File path: 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:
Review comment:
cc @ueshin FYI
--
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
[GitHub] [spark] itholic commented on a change in pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
Posted by GitBox <gi...@apache.org>.
itholic commented on a change in pull request #36034:
URL: https://github.com/apache/spark/pull/36034#discussion_r840219156
##########
File path: python/docs/source/reference/pyspark.pandas/general_functions.rst
##########
@@ -52,18 +53,25 @@ Top-level missing data
.. autosummary::
:toctree: api/
- to_numeric
isna
isnull
notna
notnull
-Top-level dealing with datetimelike
+Top-level dealing with numeric data
-----------------------------------
+
+.. autosummary::
+ :toctree: api/
+
+ to_numeric
+
+Top-level dealing with datetimelike data
+----------------------------------------
Review comment:
Just for matching pandas documents as below:
<img width="618" alt="Screen Shot 2022-04-01 at 1 22 51 PM" src="https://user-images.githubusercontent.com/44108233/161194528-322aa739-12a1-4fb3-9741-05b2124f38bc.png">
--
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
[GitHub] [spark] itholic commented on a change in pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
Posted by GitBox <gi...@apache.org>.
itholic commented on a change in pull request #36034:
URL: https://github.com/apache/spark/pull/36034#discussion_r840222794
##########
File path: python/pyspark/pandas/missing/general_functions.py
##########
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+from pyspark.pandas.missing import unsupported_function
+
+
+def _unsupported_function(method_name, deprecated=False, reason=""):
+ return unsupported_function(
+ class_name="pd", method_name=method_name, deprecated=deprecated, reason=reason
+ )
+
+
+class _MissingPandasLikeGeneralFunctions:
+
+ pivot = _unsupported_function("pivot")
+ pivot_table = _unsupported_function("pivot_table")
+ crosstab = _unsupported_function("crosstab")
+ cut = _unsupported_function("cut")
+ qcut = _unsupported_function("qcut")
+ merge_ordered = _unsupported_function("merge_ordered")
+ factorize = _unsupported_function("factorize")
+ unique = _unsupported_function("unique")
+ wide_to_long = _unsupported_function("wide_to_long")
+ bdate_range = _unsupported_function("bdate_range")
+ period_range = _unsupported_function("period_range")
+ infer_freq = _unsupported_function("infer_freq")
+ interval_range = _unsupported_function("interval_range")
+ eval = _unsupported_function("eval")
Review comment:
Sure!
--
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
[GitHub] [spark] itholic commented on a change in pull request #36034: [SPARK-38755][PYTHON][TEST] Add file to address missing pandas general functions
Posted by GitBox <gi...@apache.org>.
itholic commented on a change in pull request #36034:
URL: https://github.com/apache/spark/pull/36034#discussion_r840218888
##########
File path: python/docs/source/reference/pyspark.pandas/general_functions.rst
##########
@@ -52,18 +53,25 @@ Top-level missing data
.. autosummary::
:toctree: api/
- to_numeric
isna
isnull
notna
notnull
-Top-level dealing with datetimelike
+Top-level dealing with numeric data
-----------------------------------
+
+.. autosummary::
+ :toctree: api/
+
+ to_numeric
+
+Top-level dealing with datetimelike data
+----------------------------------------
.. autosummary::
:toctree: api/
to_datetime
date_range
to_timedelta
- timedelta_range
\ No newline at end of file
+ timedelta_range
Review comment:
Not sure why this is in diff even though there is no change on this.
--
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