Skip to content

Commit 2891f78

Browse files
authored
Merge pull request #668 from jupyter-incubator/master
Release from master
2 parents fe2627f + 5a42ec0 commit 2891f78

File tree

13 files changed

+39
-14
lines changed

13 files changed

+39
-14
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.16.0
4+
5+
### Bug fixes
6+
7+
* Fix ContextualVersionConflict in Dockerfile.spark. Thanks Linan Zheng, @LinanZheng
8+
* Fix Info Subcommand in RemoteSparkMagic. Thanks Linan Zheng, @LinanZheng
9+
* Fix to ignore unsupported spark session types whilst fetching the session list. Thanks, Murat Burak Migdisoglu, @mmigdiso
10+
311
## 0.15.0
412

513
### Features

Dockerfile.spark

+11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -yq --no-install-recommends --force-yes \
1111
r-base-core && \
1212
rm -rf /var/lib/apt/lists/*
1313

14+
# Install pip for Python3
1415
RUN easy_install3 pip py4j
1516
RUN pip install --upgrade setuptools
1617

@@ -30,9 +31,19 @@ RUN mkdir -p /apps/build && \
3031
cp -r /apps/build/spark/dist $SPARK_HOME && \
3132
rm -rf $SPARK_BUILD_PATH
3233

34+
# ----------
35+
# Build Livy
36+
# ----------
3337
ENV LIVY_BUILD_VERSION 0.6.0-incubating
3438
ENV LIVY_APP_PATH /apps/apache-livy-$LIVY_BUILD_VERSION-bin
3539
ENV LIVY_BUILD_PATH /apps/build/livy
40+
41+
# Install setuptools for Python 2.7 for Livy
42+
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
43+
python get-pip.py --user && \
44+
rm get-pip.py && \
45+
python -m pip install --upgrade setuptools
46+
3647
RUN cd /apps/build && \
3748
git clone https://github.com/apache/incubator-livy.git livy && \
3849
cd $LIVY_BUILD_PATH && \

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ The sparkmagic library provides a %%spark magic that you can use to easily run c
3737
The sparkmagic library also provides a set of Scala and Python kernels that allow you to automatically connect to a remote Spark cluster, run code and SQL queries, manage your Livy server and Spark job configuration, and generate automatic visualizations.
3838
See [Pyspark](examples/Pyspark%20Kernel.ipynb) and [Spark](examples/Spark%20Kernel.ipynb) sample notebooks.
3939

40-
### 3. Sending data to Spark%20Kernel
40+
### 3. Sending local data to Spark Kernel
4141

42-
See the [sending data to Spark notebook](examples/Send local data to Spark.ipynb).
42+
See the [Sending Local Data to Spark notebook](examples/Send%20local%20data%20to%20Spark.ipynb).
4343

4444
## Installation
4545

@@ -53,7 +53,7 @@ See the [sending data to Spark notebook](examples/Send local data to Spark.ipynb
5353

5454
3. If you're using JupyterLab, you'll need to run another command:
5555

56-
jupyter labextension install @jupyter-widgets/jupyterlab-manager
56+
jupyter labextension install "@jupyter-widgets/jupyterlab-manager"
5757

5858
4. (Optional) Install the wrapper kernels. Do `pip show sparkmagic` and it will show the path where `sparkmagic` is installed at. `cd` to that location and do:
5959

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.15.0'
1+
__version__ = '0.16.0'
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.15.0'
1+
__version__ = '0.16.0'

hdijupyterutils/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ jupyter>=1
77
pandas>=0.17.1
88
numpy
99
notebook>=4.2
10+
# Work around broken-on-Python-2 pyrsistent release:
11+
pyrsistent < 0.17 ; python_version < '3.0'

hdijupyterutils/setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@ def version(path):
6464
'jupyter>=1',
6565
'pandas>=0.17.1',
6666
'numpy',
67-
'notebook>=4.2'
67+
'notebook>=4.2',
68+
# Work around broken-on-Python-2 pyrsistent release:
69+
"pyrsistent < 0.17 ; python_version < '3.0'",
6870
])

sparkmagic/sparkmagic/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.15.0'
1+
__version__ = '0.16.0'
22

33
from sparkmagic.serverextension.handlers import load_jupyter_server_extension
44

sparkmagic/sparkmagic/kernels/kernelmagics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def help(self, line, cell="", local_ns=None):
138138
</tr>
139139
<tr>
140140
<td>send_to_spark</td>
141-
<td>%%send_to_spark -o variable -t str -n var</td>
141+
<td>%%send_to_spark -i variable -t str -n var</td>
142142
<td>Sends a variable from local output to spark cluster.
143143
<br/>
144144
Parameters:

sparkmagic/sparkmagic/livyclientlib/sparkcontroller.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ def run_sqlquery(self, sqlquery, client_name=None):
4646
def get_all_sessions_endpoint(self, endpoint):
4747
http_client = self._http_client(endpoint)
4848
sessions = http_client.get_sessions()[u"sessions"]
49+
supported_sessions = filter(lambda s: (s[constants.LIVY_KIND_PARAM] in constants.SESSION_KINDS_SUPPORTED), sessions)
4950
session_list = [self._livy_session(http_client, {constants.LIVY_KIND_PARAM: s[constants.LIVY_KIND_PARAM]},
5051
self.ipython_display, s[u"id"])
51-
for s in sessions]
52+
for s in supported_sessions]
5253
for s in session_list:
5354
s.refresh_status_and_info()
5455
return session_list

sparkmagic/sparkmagic/magics/remotesparkmagics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ def spark(self, line, cell="", local_ns=None):
119119

120120
# info
121121
if subcommand == "info":
122-
if args.url is not None:
122+
if args.url is not None and args.id is not None:
123123
endpoint = Endpoint(args.url, args.auth, args.user, args.password)
124124
info_sessions = self.spark_controller.get_all_sessions_endpoint_info(endpoint)
125-
self._print_endpoint_info(info_sessions)
125+
self._print_endpoint_info(info_sessions, args.id)
126126
else:
127127
self._print_local_info()
128128
# config

sparkmagic/sparkmagic/tests/test_remotesparkmagics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ def test_info_command_parses():
4545
def test_info_endpoint_command_parses():
4646
print_info_mock = MagicMock()
4747
magic._print_endpoint_info = print_info_mock
48-
command = "info -u http://microsoft.com"
48+
command = "info -u http://microsoft.com -i 1234"
4949
spark_controller.get_all_sessions_endpoint_info = MagicMock(return_value=None)
5050

5151
magic.spark(command)
5252

53-
print_info_mock.assert_called_once_with(None)
53+
print_info_mock.assert_called_once_with(None,1234)
5454

5555

5656
@with_setup(_setup, _teardown)

sparkmagic/sparkmagic/tests/test_sparkcontroller.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ def test_get_client_keys():
132132
@with_setup(_setup, _teardown)
133133
def test_get_all_sessions():
134134
http_client = MagicMock()
135-
http_client.get_sessions.return_value = json.loads('{"from":0,"total":2,"sessions":[{"id":0,"state":"idle","kind":'
135+
http_client.get_sessions.return_value = json.loads('{"from":0,"total":3,"sessions":[{"id":0,"state":"idle","kind":'
136136
'"spark","log":[""]}, {"id":1,"state":"busy","kind":"spark","log"'
137+
':[""]},{"id":2,"state":"busy","kind":"sql","log"'
137138
':[""]}]}')
138139
controller._http_client = MagicMock(return_value=http_client)
139140
controller._livy_session = MagicMock()

0 commit comments

Comments
 (0)