Skip to content

Commit d07d21d

Browse files
committed
feedback
1 parent c232ec6 commit d07d21d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

python/pyspark/java_gateway.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,20 @@ def _do_server_auth(conn, auth_secret):
147147
raise Exception("Unexpected reply from iterator server.")
148148

149149

150-
def local_connect_and_auth(sock_info):
150+
def local_connect_and_auth(port, auth_secret):
151151
"""
152152
Connect to local host, authenticate with it, and return a (sockfile,sock) for that connection.
153153
Handles IPV4 & IPV6, does some error handling.
154-
:param sock_info: a tuple of (port, auth_secret) for connecting
154+
:param port
155+
:param auth_secret
155156
:return: a tuple with (sockfile, sock)
156157
"""
157-
port, auth_secret = sock_info
158158
sock = None
159159
errors = []
160160
# Support for both IPv4 and IPv6.
161161
# On most of IPv6-ready systems, IPv6 will take precedence.
162162
for res in socket.getaddrinfo("127.0.0.1", port, socket.AF_UNSPEC, socket.SOCK_STREAM):
163-
af, socktype, proto, canonname, sa = res
163+
af, socktype, proto, _, sa = res
164164
sock = socket.socket(af, socktype, proto)
165165
try:
166166
sock.settimeout(15)

python/pyspark/rdd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _parse_memory(s):
141141

142142

143143
def _load_from_socket(sock_info, serializer):
144-
(sockfile, sock) = local_connect_and_auth(sock_info)
144+
(sockfile, sock) = local_connect_and_auth(*sock_info)
145145
# The RDD materialization time is unpredicable, if we set a timeout for socket reading
146146
# operation, it will very possibly fail. See SPARK-18281.
147147
sock.settimeout(None)

python/pyspark/taskcontext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _load_from_socket(port, auth_secret):
109109
Load data from a given socket, this is a blocking method thus only return when the socket
110110
connection has been closed.
111111
"""
112-
(sockfile, sock) = local_connect_and_auth((port, auth_secret))
112+
(sockfile, sock) = local_connect_and_auth(port, auth_secret)
113113
# Make a barrier() function call.
114114
write_int(BARRIER_FUNCTION, sockfile)
115115
sockfile.flush()

python/pyspark/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,5 +364,5 @@ def process():
364364
# Read information about how to connect back to the JVM from the environment.
365365
java_port = int(os.environ["PYTHON_WORKER_FACTORY_PORT"])
366366
auth_secret = os.environ["PYTHON_WORKER_FACTORY_SECRET"]
367-
(sock_file, _) = local_connect_and_auth((java_port, auth_secret))
367+
(sock_file, _) = local_connect_and_auth(java_port, auth_secret)
368368
main(sock_file, sock_file)

0 commit comments

Comments
 (0)