dataproc-spark-connect 0.8.0__py2.py3-none-any.whl → 0.8.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dataproc_spark_connect-0.8.0.dist-info → dataproc_spark_connect-0.8.1.dist-info}/METADATA +1 -1
- {dataproc_spark_connect-0.8.0.dist-info → dataproc_spark_connect-0.8.1.dist-info}/RECORD +6 -6
- google/cloud/dataproc_spark_connect/session.py +51 -6
- {dataproc_spark_connect-0.8.0.dist-info → dataproc_spark_connect-0.8.1.dist-info}/WHEEL +0 -0
- {dataproc_spark_connect-0.8.0.dist-info → dataproc_spark_connect-0.8.1.dist-info}/licenses/LICENSE +0 -0
- {dataproc_spark_connect-0.8.0.dist-info → dataproc_spark_connect-0.8.1.dist-info}/top_level.txt +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
dataproc_spark_connect-0.8.
|
|
1
|
+
dataproc_spark_connect-0.8.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
2
2
|
google/cloud/dataproc_spark_connect/__init__.py,sha256=dIqHNWVWWrSuRf26x11kX5e9yMKSHCtmI_GBj1-FDdE,1101
|
|
3
3
|
google/cloud/dataproc_spark_connect/exceptions.py,sha256=WF-qdzgdofRwILCriIkjjsmjObZfF0P3Ecg4lv-Hmec,968
|
|
4
4
|
google/cloud/dataproc_spark_connect/pypi_artifacts.py,sha256=gd-VMwiVP-EJuPp9Vf9Shx8pqps3oSKp0hBcSSZQS-A,1575
|
|
5
|
-
google/cloud/dataproc_spark_connect/session.py,sha256=
|
|
5
|
+
google/cloud/dataproc_spark_connect/session.py,sha256=o7N68KddasHkANrNPxsq4Uij711eAaNz4oKa7jGdsaY,32017
|
|
6
6
|
google/cloud/dataproc_spark_connect/client/__init__.py,sha256=6hCNSsgYlie6GuVpc5gjFsPnyeMTScTpXSPYqp1fplY,615
|
|
7
7
|
google/cloud/dataproc_spark_connect/client/core.py,sha256=m3oXTKBm3sBy6jhDu9GRecrxLb5CdEM53SgMlnJb6ag,4616
|
|
8
8
|
google/cloud/dataproc_spark_connect/client/proxy.py,sha256=qUZXvVY1yn934vE6nlO495XUZ53AUx9O74a9ozkGI9U,8976
|
|
9
|
-
dataproc_spark_connect-0.8.
|
|
10
|
-
dataproc_spark_connect-0.8.
|
|
11
|
-
dataproc_spark_connect-0.8.
|
|
12
|
-
dataproc_spark_connect-0.8.
|
|
9
|
+
dataproc_spark_connect-0.8.1.dist-info/METADATA,sha256=vrvJk30s46CeD-1AZC05zaUtX4ENurK8Ee90Bsb4XEQ,3465
|
|
10
|
+
dataproc_spark_connect-0.8.1.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
11
|
+
dataproc_spark_connect-0.8.1.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
|
|
12
|
+
dataproc_spark_connect-0.8.1.dist-info/RECORD,,
|
|
@@ -253,10 +253,9 @@ class DataprocSparkSession(SparkSession):
|
|
|
253
253
|
operation = SessionControllerClient(
|
|
254
254
|
client_options=self._client_options
|
|
255
255
|
).create_session(session_request)
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
)
|
|
259
|
-
self._display_view_session_details_button(session_id)
|
|
256
|
+
self._display_session_link_on_creation(session_id)
|
|
257
|
+
# TODO: Add the 'View Session Details' button once the UI changes are done.
|
|
258
|
+
# self._display_view_session_details_button(session_id)
|
|
260
259
|
create_session_pbar_thread.start()
|
|
261
260
|
session_response: Session = operation.result(
|
|
262
261
|
polling=retry.Retry(
|
|
@@ -269,7 +268,7 @@ class DataprocSparkSession(SparkSession):
|
|
|
269
268
|
)
|
|
270
269
|
stop_create_session_pbar_event.set()
|
|
271
270
|
create_session_pbar_thread.join()
|
|
272
|
-
|
|
271
|
+
self._print_session_created_message()
|
|
273
272
|
file_path = (
|
|
274
273
|
DataprocSparkSession._get_active_session_file_path()
|
|
275
274
|
)
|
|
@@ -314,6 +313,46 @@ class DataprocSparkSession(SparkSession):
|
|
|
314
313
|
session_response, dataproc_config.name
|
|
315
314
|
)
|
|
316
315
|
|
|
316
|
+
def _display_session_link_on_creation(self, session_id):
|
|
317
|
+
session_url = f"https://console.cloud.google.com/dataproc/interactive/{self._region}/{session_id}?project={self._project_id}"
|
|
318
|
+
plain_message = f"Creating Dataproc Session: {session_url}"
|
|
319
|
+
html_element = f"""
|
|
320
|
+
<div>
|
|
321
|
+
<p>Creating Dataproc Spark Session<p>
|
|
322
|
+
<p><a href="{session_url}">Dataproc Session</a></p>
|
|
323
|
+
</div>
|
|
324
|
+
"""
|
|
325
|
+
|
|
326
|
+
self._output_element_or_message(plain_message, html_element)
|
|
327
|
+
|
|
328
|
+
def _print_session_created_message(self):
|
|
329
|
+
plain_message = f"Dataproc Session was successfully created"
|
|
330
|
+
html_element = f"<div><p>{plain_message}</p></div>"
|
|
331
|
+
|
|
332
|
+
self._output_element_or_message(plain_message, html_element)
|
|
333
|
+
|
|
334
|
+
def _output_element_or_message(self, plain_message, html_element):
|
|
335
|
+
"""
|
|
336
|
+
Display / print the needed rich HTML element or plain text depending
|
|
337
|
+
on whether rich element is supported or not.
|
|
338
|
+
|
|
339
|
+
:param plain_message: Message to print on non-IPython or
|
|
340
|
+
non-interactive shell
|
|
341
|
+
:param html_element: HTML element to display for interactive IPython
|
|
342
|
+
environment
|
|
343
|
+
"""
|
|
344
|
+
try:
|
|
345
|
+
from IPython.display import display, HTML
|
|
346
|
+
from IPython.core.interactiveshell import InteractiveShell
|
|
347
|
+
|
|
348
|
+
if not InteractiveShell.initialized():
|
|
349
|
+
raise DataprocSparkConnectException(
|
|
350
|
+
"Not in an Interactive IPython Environment"
|
|
351
|
+
)
|
|
352
|
+
display(HTML(html_element))
|
|
353
|
+
except (ImportError, DataprocSparkConnectException):
|
|
354
|
+
print(plain_message)
|
|
355
|
+
|
|
317
356
|
def _get_exiting_active_session(
|
|
318
357
|
self,
|
|
319
358
|
) -> Optional["DataprocSparkSession"]:
|
|
@@ -334,7 +373,8 @@ class DataprocSparkSession(SparkSession):
|
|
|
334
373
|
print(
|
|
335
374
|
f"Using existing Dataproc Session (configuration changes may not be applied): https://console.cloud.google.com/dataproc/interactive/{self._region}/{s8s_session_id}?project={self._project_id}"
|
|
336
375
|
)
|
|
337
|
-
|
|
376
|
+
# TODO: Add the 'View Session Details' button once the UI changes are done.
|
|
377
|
+
# self._display_view_session_details_button(s8s_session_id)
|
|
338
378
|
if session is None:
|
|
339
379
|
session = self.__create_spark_connect_session_from_s8s(
|
|
340
380
|
session_response, session_name
|
|
@@ -453,6 +493,11 @@ class DataprocSparkSession(SparkSession):
|
|
|
453
493
|
def _display_view_session_details_button(self, session_id):
|
|
454
494
|
try:
|
|
455
495
|
session_url = f"https://console.cloud.google.com/dataproc/interactive/sessions/{session_id}/locations/{self._region}?project={self._project_id}"
|
|
496
|
+
from IPython.core.interactiveshell import InteractiveShell
|
|
497
|
+
|
|
498
|
+
if not InteractiveShell.initialized():
|
|
499
|
+
return
|
|
500
|
+
|
|
456
501
|
from google.cloud.aiplatform.utils import _ipython_utils
|
|
457
502
|
|
|
458
503
|
_ipython_utils.display_link(
|
|
File without changes
|
{dataproc_spark_connect-0.8.0.dist-info → dataproc_spark_connect-0.8.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{dataproc_spark_connect-0.8.0.dist-info → dataproc_spark_connect-0.8.1.dist-info}/top_level.txt
RENAMED
|
File without changes
|