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 2020/07/07 09:18:36 UTC

[GitHub] [spark] Matzz opened a new pull request #29023: local_connect_and_auth takes 2 arguments, 3 given

Matzz opened a new pull request #29023:
URL: https://github.com/apache/spark/pull/29023


   When I use `toPandas` on RDD created from Postgresql query I get following error:
   ```
   pyspark/sql/dataframe.py:2138: UserWarning: toPandas attempted Arrow optimization because 'spark.sql.execution.arrow.enabled' is set to true, but has reached the error below and can not continue. Note that 'spark.sql.execution.arrow.fallback.enabled' does not have an effect on failures in the middle of computation.
     local_connect_and_auth() takes 2 positional arguments but 3 were given
     warnings.warn(msg)
   
   Traceback (most recent call last):
     File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
       "__main__", mod_spec)
     File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
       exec(code, run_globals)
     File "__main__.py", line 6, in <module>
       run(session)
     File "app.py", line 30, in run
       list = df.toPandas()
     File "pyspark/sql/dataframe.py", line 2121, in toPandas
       batches = self._collectAsArrow()
     File "pyspark/sql/dataframe.py", line 2179, in _collectAsArrow
       return list(_load_from_socket(sock_info, ArrowStreamSerializer()))
     File "pyspark/rdd.py", line 144, in _load_from_socket
       (sockfile, sock) = local_connect_and_auth(*sock_info)
   TypeError: local_connect_and_auth() takes 2 positional arguments but 3 were given
   ```
   It disappear when I disable Arrow. 
   
   `sock_info` contain following elements:
   ```
   33719
   aaf86d48dcee5958e0c4a34c858dc2d6a8bbadb1058b3ac260acaf9f2aa782ed
   org.apache.spark.api.python.SocketFuncServer@19359bb7
   ```
   so its `port`, `auth_secret`, and `SocketFunServer` which we don't need here. On spark v3 branch we use only 2 first elements of that tuple.
   I backported changes from v3 here to get rid of that bug.
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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






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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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






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

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] onzo-mateuszzakarczemny commented on a change in pull request #29023: local_connect_and_auth takes 2 arguments, 3 given

Posted by GitBox <gi...@apache.org>.
onzo-mateuszzakarczemny commented on a change in pull request #29023:
URL: https://github.com/apache/spark/pull/29023#discussion_r451726044



##########
File path: python/pyspark/rdd.py
##########
@@ -141,7 +141,9 @@ def _parse_memory(s):
 
 
 def _load_from_socket(sock_info, serializer):
-    (sockfile, sock) = local_connect_and_auth(*sock_info)
+    port = sock_info[0]
+    auth_secret = sock_info[1]
+    (sockfile, sock) = local_connect_and_auth(port, auth_secret)

Review comment:
       @HyukjinKwon You are linking to `dataframe.py` but I patched `rdd.py`
   The code is there:
   https://github.com/apache/spark/blob/v2.4.4/python/pyspark/rdd.py#L144
   
   So `(*sock_info)` is used instead of passing individual touple values.




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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   **[Test build #125228 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/125228/testReport)** for PR 29023 at commit [`2e2534f`](https://github.com/apache/spark/commit/2e2534f1ec4323b96df966b88cdb006609ca892b).
    * 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.

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   **[Test build #125228 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/125228/testReport)** for PR 29023 at commit [`2e2534f`](https://github.com/apache/spark/commit/2e2534f1ec4323b96df966b88cdb006609ca892b).


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   Can one of the admins verify this patch?


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   **[Test build #125228 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/125228/testReport)** for PR 29023 at commit [`2e2534f`](https://github.com/apache/spark/commit/2e2534f1ec4323b96df966b88cdb006609ca892b).


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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



##########
File path: python/pyspark/rdd.py
##########
@@ -141,7 +141,9 @@ def _parse_memory(s):
 
 
 def _load_from_socket(sock_info, serializer):
-    (sockfile, sock) = local_connect_and_auth(*sock_info)
+    port = sock_info[0]
+    auth_secret = sock_info[1]
+    (sockfile, sock) = local_connect_and_auth(port, auth_secret)

Review comment:
       This was correctly ported back at https://github.com/apache/spark/pull/25593. There's no such code you pointed out in Spark 2.4.4: https://github.com/apache/spark/blob/v2.4.4/python/pyspark/sql/dataframe.py#L2182.
   
   Are you using your own fork or mixing the Spark versions? Your error message seems from https://github.com/apache/spark/blob/v2.4.3/python/pyspark/sql/dataframe.py#L2179 which is Spark 2.4.3. Spark 2.4.3 does not have this change.
   
   




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

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] dongjoon-hyun commented on pull request #29023: local_connect_and_auth takes 2 arguments, 3 given

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #29023:
URL: https://github.com/apache/spark/pull/29023#issuecomment-654896018


   ok to test


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

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] dongjoon-hyun commented on pull request #29023: local_connect_and_auth takes 2 arguments, 3 given

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #29023:
URL: https://github.com/apache/spark/pull/29023#issuecomment-654896232


   Hi, @Matzz . Could you file a JIRA issue for 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.

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   Can one of the admins verify this patch?


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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






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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   Can one of the admins verify this patch?


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   Thanks @dongjoon-hyun for cc'ing me. @Matzz can you show how you tested it?


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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






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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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


   Can one of the admins verify this patch?


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

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] dongjoon-hyun commented on pull request #29023: local_connect_and_auth takes 2 arguments, 3 given

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #29023:
URL: https://github.com/apache/spark/pull/29023#issuecomment-654966208


   cc @HyukjinKwon 


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

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 #29023: local_connect_and_auth takes 2 arguments, 3 given

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



##########
File path: python/pyspark/rdd.py
##########
@@ -141,7 +141,9 @@ def _parse_memory(s):
 
 
 def _load_from_socket(sock_info, serializer):
-    (sockfile, sock) = local_connect_and_auth(*sock_info)
+    port = sock_info[0]
+    auth_secret = sock_info[1]
+    (sockfile, sock) = local_connect_and_auth(port, auth_secret)

Review comment:
       Yeah, I actually already pointed it out it's error-prone. Feel free to open another PR to fix it.

##########
File path: python/pyspark/rdd.py
##########
@@ -141,7 +141,9 @@ def _parse_memory(s):
 
 
 def _load_from_socket(sock_info, serializer):
-    (sockfile, sock) = local_connect_and_auth(*sock_info)
+    port = sock_info[0]
+    auth_secret = sock_info[1]
+    (sockfile, sock) = local_connect_and_auth(port, auth_secret)

Review comment:
       Yeah, I actually already pointed it out it's error-prone in the previous PR. Feel free to open another PR to fix it.




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

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] onzo-mateuszzakarczemny commented on a change in pull request #29023: local_connect_and_auth takes 2 arguments, 3 given

Posted by GitBox <gi...@apache.org>.
onzo-mateuszzakarczemny commented on a change in pull request #29023:
URL: https://github.com/apache/spark/pull/29023#discussion_r451734489



##########
File path: python/pyspark/rdd.py
##########
@@ -141,7 +141,9 @@ def _parse_memory(s):
 
 
 def _load_from_socket(sock_info, serializer):
-    (sockfile, sock) = local_connect_and_auth(*sock_info)
+    port = sock_info[0]
+    auth_secret = sock_info[1]
+    (sockfile, sock) = local_connect_and_auth(port, auth_secret)

Review comment:
       Ok I see now. It is possible that that I messed something while using pipenv. 
   Anyway I feel that using `(*sock_info)` is inherently unsafe and prone to such errors.




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

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