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 2021/10/26 12:16:42 UTC

[GitHub] [spark] bjornjorgensen commented on a change in pull request #34389: [SPARK-37036][PYTHON] Add util function to raise advice warning for pandas API on Spark.

bjornjorgensen commented on a change in pull request #34389:
URL: https://github.com/apache/spark/pull/34389#discussion_r736470876



##########
File path: python/pyspark/pandas/frame.py
##########
@@ -4808,6 +4842,10 @@ def to_pandas(self) -> pd.DataFrame:
         2   0.6   0.0
         3   0.2   0.1
         """
+        log_advice(
+            "`to_pandas` loads the all data into the driver's memory. "

Review comment:
       "`to_pandas` loads all data into the driver's memory. "
   

##########
File path: python/pyspark/pandas/generic.py
##########
@@ -573,6 +574,10 @@ def to_numpy(self) -> np.ndarray:
         >>> ps.Series(['a', 'b', 'a']).to_numpy()
         array(['a', 'b', 'a'], dtype=object)
         """
+        log_advice(
+            "`to_numpy` loads the all data into the driver's memory. "

Review comment:
       "`to_numpy` loads all data into the driver's memory. "

##########
File path: python/pyspark/pandas/indexes/base.py
##########
@@ -488,6 +489,10 @@ def to_pandas(self) -> pd.Index:
         >>> df['dogs'].index.to_pandas()
         Index(['a', 'b', 'c', 'd'], dtype='object')
         """
+        log_advice(
+            "`to_pandas` loads the all data into the driver's memory. "

Review comment:
       "`to_pandas` loads all data into the driver's memory. "

##########
File path: python/pyspark/pandas/series.py
##########
@@ -1580,6 +1581,10 @@ def to_pandas(self) -> pd.Series:
         3    0.2
         Name: dogs, dtype: float64
         """
+        log_advice(
+            "`to_pandas` loads the all data into the driver's memory. "

Review comment:
       "`to_pandas` loads all data into the driver's memory. "

##########
File path: python/pyspark/pandas/generic.py
##########
@@ -1142,6 +1147,10 @@ def to_excel(
 
         >>> df1.to_excel('output1.xlsx', engine='xlsxwriter')  # doctest: +SKIP
         """
+        log_advice(
+            "`to_excel` loads the all data into the driver's memory. "

Review comment:
       "`to_excel` loads all data into the driver's memory. "

##########
File path: python/pyspark/pandas/generic.py
##########
@@ -2997,6 +3006,10 @@ def to_markdown(
             raise NotImplementedError(
                 "`to_markdown()` only supported in pandas-on-Spark with pandas >= 1.0.0"
             )
+        log_advice(
+            "`to_markdown` loads the all data into the driver's memory. "

Review comment:
       "`to_markdown` loads all data into the driver's memory. "

##########
File path: python/pyspark/pandas/indexes/base.py
##########
@@ -2549,6 +2557,10 @@ def to_list(self) -> List:
         >>> midx.to_list()
         [(1, 'red'), (1, 'blue'), (2, 'red'), (2, 'green')]
         """
+        log_advice(
+            "`to_list` loads the all data into the driver's memory. "

Review comment:
       "`to_list` loads all data into the driver's memory. "

##########
File path: python/pyspark/pandas/series.py
##########
@@ -1594,6 +1599,10 @@ def to_list(self) -> List:
             to be small, as all the data is loaded into the driver's memory.
 
         """
+        log_advice(
+            "`to_list` loads the all data into the driver's memory. "

Review comment:
       "`to_list` loads all data into the driver's memory. "




-- 
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