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/07/19 08:17:45 UTC

[GitHub] [spark] itholic opened a new pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

itholic opened a new pull request #33414:
URL: https://github.com/apache/spark/pull/33414


   ### What changes were proposed in this pull request?
   
   The `DataFrame.to_csv` has `mode` arguments both in pandas and pandas API on Spark.
   
   However, pandas allows the string "w", "w+", "a", "a+" where as pandas-on-Spark allows "append", "overwrite", "ignore", "error" or "errorifexists".
   
   We should map them while `mode` can still accept the existing parameters("append", "overwrite", "ignore", "error" or "errorifexists") as well.
   
   ### Why are the changes needed?
   
   APIs in pandas-on-Spark should follows the behavior of pandas for preventing the existing pandas code break.
   
   ### Does this PR introduce _any_ user-facing change?
   
   `DataFrame.to_csv` now can accept "w", "w+", "a", "a+" as well, same as pandas.
   
   ### How was this patch tested?
   
   Add the unit test and manually write the file with the new acceptable strings.


-- 
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] SparkQA commented on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882415503


   **[Test build #141235 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141235/testReport)** for PR 33414 at commit [`59512d5`](https://github.com/apache/spark/commit/59512d5b54639aa311795432f93c371cace87789).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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] AmplabJenkins commented on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882410052






-- 
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 pull request #33414: [SPARK-35806][PYTHON] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882451824


   Java build is hardly likely related to Python changes .. 
   
   Merged to master and branch-3.2.


-- 
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 #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #33414:
URL: https://github.com/apache/spark/pull/33414#discussion_r672196465



##########
File path: python/pyspark/pandas/generic.py
##########
@@ -688,14 +689,16 @@ def to_csv(
             when appropriate.
         num_files : the number of files to be written in `path` directory when
             this is a path.
-        mode : str {'append', 'overwrite', 'ignore', 'error', 'errorifexists'},
-            default 'overwrite'. Specifies the behavior of the save operation when the
-            destination exists already.
+        mode : str
+            Python write mode, default 'w'.
 
-            - 'append': Append the new data to existing data.
-            - 'overwrite': Overwrite existing data.
-            - 'ignore': Silently ignore this operation if data already exists.
-            - 'error' or 'errorifexists': Throw an exception if data already exists.
+            .. note:: mode can accept the strings for Spark writing mode.
+                Such as 'append', 'overwrite', 'ignore', 'error', 'errorifexists'.

Review comment:
       ```suggestion
               .. note:: mode can accept the strings for Spark writing mode
                   such as 'append', 'overwrite', 'ignore', 'error', 'errorifexists'.
   ```




-- 
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] AmplabJenkins removed a comment on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882410052






-- 
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] SparkQA commented on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882369313






-- 
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 closed pull request #33414: [SPARK-35806][PYTHON] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #33414:
URL: https://github.com/apache/spark/pull/33414


   


-- 
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 #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #33414:
URL: https://github.com/apache/spark/pull/33414#discussion_r672196465



##########
File path: python/pyspark/pandas/generic.py
##########
@@ -688,14 +689,16 @@ def to_csv(
             when appropriate.
         num_files : the number of files to be written in `path` directory when
             this is a path.
-        mode : str {'append', 'overwrite', 'ignore', 'error', 'errorifexists'},
-            default 'overwrite'. Specifies the behavior of the save operation when the
-            destination exists already.
+        mode : str
+            Python write mode, default 'w'.
 
-            - 'append': Append the new data to existing data.
-            - 'overwrite': Overwrite existing data.
-            - 'ignore': Silently ignore this operation if data already exists.
-            - 'error' or 'errorifexists': Throw an exception if data already exists.
+            .. note:: mode can accept the strings for Spark writing mode.
+                Such as 'append', 'overwrite', 'ignore', 'error', 'errorifexists'.

Review comment:
       ```suggestion
               .. note:: mode can accept the strings for Spark writing mode
                   such as 'append', 'overwrite', 'ignore', 'error', 'errorifexists'.
   ```




-- 
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] AmplabJenkins removed a comment on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882410052


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/45749/
   


-- 
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] AmplabJenkins commented on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882410052


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/45749/
   


-- 
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 pull request #33414: [SPARK-35806][PYTHON] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882451824


   Java build is hardly likely related to Python changes .. 
   
   Merged to master and branch-3.2.


-- 
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 closed pull request #33414: [SPARK-35806][PYTHON] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #33414:
URL: https://github.com/apache/spark/pull/33414


   


-- 
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] AmplabJenkins commented on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882415937


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/141235/
   


-- 
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] SparkQA commented on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882369313


   **[Test build #141235 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141235/testReport)** for PR 33414 at commit [`59512d5`](https://github.com/apache/spark/commit/59512d5b54639aa311795432f93c371cace87789).


-- 
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] SparkQA removed a comment on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882369313


   **[Test build #141235 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141235/testReport)** for PR 33414 at commit [`59512d5`](https://github.com/apache/spark/commit/59512d5b54639aa311795432f93c371cace87789).


-- 
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] SparkQA commented on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882408265


   Kubernetes integration test unable to build dist.
   
   exiting with code: 1
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/45749/
   


-- 
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] AmplabJenkins removed a comment on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882415937


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/141235/
   


-- 
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] SparkQA removed a comment on pull request #33414: [SPARK-35806] Mapping the `mode` argument to pandas in DataFrame.to_csv

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33414:
URL: https://github.com/apache/spark/pull/33414#issuecomment-882369313


   **[Test build #141235 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141235/testReport)** for PR 33414 at commit [`59512d5`](https://github.com/apache/spark/commit/59512d5b54639aa311795432f93c371cace87789).


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