Skip to content

Commit 569f51a

Browse files
committed
Merge branch 'master' into release
2 parents 9912e56 + eed2259 commit 569f51a

22 files changed

+846
-46
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## NEXT RELEASE
44

5+
## 0.19.0
6+
7+
### Features
8+
9+
* Added one internal magic to enable retry of session creation. Thanks @edwardps
10+
* New `%%pretty` magic for pretty printing a dataframe as an HTML table. Thanks @hegary
11+
* Update Endpoint widget to shield passwords when entering them in the ipywidget. Thanks @J0rg3M3nd3z @jodom961
12+
513
## 0.18.0
614

715
### Updates
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.18.0'
1+
__version__ = '0.19.0'

autovizwidget/autovizwidget/tests/test_autovizwidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from mock import MagicMock, call
22
from nose.tools import with_setup, assert_equals
33
import pandas as pd
4-
from pandas.util.testing import assert_frame_equal, assert_series_equal
4+
from pandas.testing import assert_frame_equal, assert_series_equal
55

66
from ..widget.autovizwidget import AutoVizWidget
77
from ..widget.encoding import Encoding

examples/Magics in IPython Kernel.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"## This notebook will demonstrate how we can use the spark magic to interspere our Python code with code that is running against a Spark cluster"
14+
"## This notebook will demonstrate how we can use the spark magic to intersperse our Python code with code that is running against a Spark cluster"
1515
]
1616
},
1717
{

examples/Pyspark Kernel.ipynb

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,53 @@
681681
"Use '`%%cleanup -f`' magic to delete all of the sessions for this cluster, including this notebook's session.\n",
682682
"The force flag `-f` is mandatory."
683683
]
684-
}
684+
},
685+
{
686+
"cell_type": "markdown",
687+
"metadata": {},
688+
"source": [
689+
"### Pretty Print Spark Dataframes (%%pretty)\n",
690+
"\n",
691+
"Use '`%%pretty`' magic to display a Spark dataframe as a HTML formatted table"
692+
]
693+
},
694+
{
695+
"cell_type": "code",
696+
"execution_count": 3,
697+
"metadata": {},
698+
"outputs": [
699+
{
700+
"data": {
701+
"application/vnd.jupyter.widget-view+json": {
702+
"model_id": "",
703+
"version_major": 2,
704+
"version_minor": 0
705+
},
706+
"text/plain": [
707+
]
708+
},
709+
"metadata": {},
710+
"output_type": "display_data"
711+
},
712+
{
713+
"data": {
714+
"text/html": [
715+
"<table><tr><th>age</th><th>name</th></tr><tr><td>null</td><td>Michael</td></tr><tr><td>30</td><td>Andy</td></tr><tr><td>19</td><td>Justin</td></tr></table><br /><pre></pre>"
716+
],
717+
"text/plain": [
718+
"<IPython.core.display.HTML object>"
719+
]
720+
},
721+
"metadata": {},
722+
"output_type": "display_data"
723+
}
724+
],
725+
"source": [
726+
"%%pretty\n",
727+
"df = spark.read.json(\"/apps/spark-2.3.3/examples/src/main/resources/people.json\")\n",
728+
"df.show()"
729+
]
730+
}
685731
],
686732
"metadata": {
687733
"kernelspec": {

examples/Spark Kernel.ipynb

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,59 @@
527527
"Use '`%%cleanup -f`' magic to delete all of the sessions for this cluster, including this notebook's session.\n",
528528
"The force flag `-f` is mandatory."
529529
]
530+
},
531+
{
532+
"cell_type": "markdown",
533+
"metadata": {},
534+
"source": [
535+
"### Pretty Print Spark Dataframes (%%pretty)\n",
536+
"\n",
537+
"Use '`%%pretty`' magic to display a Scala Spark dataframe as a HTML formatted table"
538+
]
539+
},
540+
{
541+
"cell_type": "code",
542+
"execution_count": 7,
543+
"metadata": {},
544+
"outputs": [
545+
{
546+
"data": {
547+
"application/vnd.jupyter.widget-view+json": {
548+
"model_id": "",
549+
"version_major": 2,
550+
"version_minor": 0
551+
},
552+
"text/plain": [
553+
"FloatProgress(value=0.0, bar_style='info', description='Progress:', layout=Layout(height='25px', width='50%'),…"
554+
]
555+
},
556+
"metadata": {},
557+
"output_type": "display_data"
558+
},
559+
{
560+
"data": {
561+
"text/html": [
562+
"<table><tr><th>col1</th><th>col2</th><th>col3</th></tr><tr><td>28</td><td>44</td><td>36</td></tr><tr><td>16</td><td>41</td><td>72</td></tr><tr><td>27</td><td>14</td><td>45</td></tr></table><br /><pre></pre>"
563+
],
564+
"text/plain": [
565+
"<IPython.core.display.HTML object>"
566+
]
567+
},
568+
"metadata": {},
569+
"output_type": "display_data"
570+
}
571+
],
572+
"source": [
573+
"%%pretty\n",
574+
"df.show()"
575+
]
576+
},
577+
{
578+
"cell_type": "code",
579+
"execution_count": null,
580+
"metadata": {},
581+
"outputs": [],
582+
"source": []
530583
}
531584
],
532585
"metadata": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.18.0'
1+
__version__ = '0.19.0'

hdijupyterutils/hdijupyterutils/ipywidgetfactory.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2015 [email protected]
22
# Distributed under the terms of the Modified BSD License.
33

4-
from ipywidgets import VBox, Output, Button, HTML, HBox, Dropdown, Checkbox, ToggleButtons, Text, Textarea, Tab
4+
from ipywidgets import VBox, Output, Button, HTML, HBox, Dropdown, Checkbox, ToggleButtons, Text, Textarea, Tab, Password
55

66

77
class IpyWidgetFactory(object):
@@ -43,6 +43,10 @@ def get_toggle_buttons(**kwargs):
4343
def get_text(**kwargs):
4444
return Text(**kwargs)
4545

46+
@staticmethod
47+
def get_password(**kwargs):
48+
return Password(**kwargs)
49+
4650
@staticmethod
4751
def get_text_area(**kwargs):
4852
return Textarea(**kwargs)

sparkmagic/sparkmagic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.18.0'
1+
__version__ = '0.19.0'
22

33
from sparkmagic.serverextension.handlers import load_jupyter_server_extension
44

sparkmagic/sparkmagic/auth/basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, parsed_attributes=None):
1818
is created from parsing %spark magic command.
1919
"""
2020
if parsed_attributes is not None:
21-
if parsed_attributes.user is '' or parsed_attributes.password is '':
21+
if parsed_attributes.user == '' or parsed_attributes.password == '':
2222
new_exc = BadUserDataException("Need to supply username and password arguments for "\
2323
"Basic Access Authentication. (e.g. -a username -p password).")
2424
raise new_exc
@@ -47,7 +47,7 @@ def get_widgets(self, widget_width):
4747
width=widget_width
4848
)
4949

50-
self.password_widget = ipywidget_factory.get_text(
50+
self.password_widget = ipywidget_factory.get_password(
5151
description='Password:',
5252
value=self.password,
5353
width=widget_width

0 commit comments

Comments
 (0)