Github user vundela commented on a diff in the pull request:
https://github.com/apache/spark/pull/17662#discussion_r111833507
--- Diff: python/pyspark/context.py ---
@@ -240,6 +240,26 @@ def signal_handler(signal, frame):
if isinstance(threading.current_thread(), threading._MainThread):
signal.signal(signal.SIGINT, signal_handler)
+ def __repr__(self):
+ return "<SparkContext master={master} appName={appName}>".format(
+ master=self.master,
+ appName=self.appName
+ )
+
+ def _repr_html_(self):
+ return """
+ <div>
+ <p><b>Spark Context</b></p>
+ <ul>
+ <li>Spark <code>v{spark_version}</code></li>
+ <li><a href="{spark_ui_url}">Spark UI</a></li>
+ </ul>
+ </div>
+ """.format(
+ spark_version=self.version,
+ spark_ui_url=self.uiWebUrl,
--- End diff --
Thanks for the explanation @rgbkrk. That make sense. The reason for asking
is method _repr_ which you have added don't have the "," at the end.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]