HyukjinKwon commented on a change in pull request #23441:
[SPARK-26349][PYSPARK] Forbid insecure py4j gateways
URL: https://github.com/apache/spark/pull/23441#discussion_r245537118
##########
File path: python/pyspark/tests/test_context.py
##########
@@ -246,6 +247,15 @@ def test_startTime(self):
with SparkContext() as sc:
self.assertGreater(sc.startTime, 0)
+ def test_forbid_insecure_gateway(self):
+ # Fail immediately if you try to create a SparkContext
+ # with an insecure gateway
+ parameters = namedtuple('MockGatewayParameters', 'auth_token')(None)
+ mock_insecure_gateway = namedtuple('MockJavaGateway',
'gateway_parameters')(parameters)
+ with self.assertRaises(Exception) as context:
Review comment:
nit: I would cache `ValueError`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]