Skip to content

Commit 9b5e30c

Browse files
authored
Merge pull request #632 from LinanZheng/bugfix/remote_spark_magic
Fix Info Subcommand in RemoteSparkMagic
2 parents a3e088e + a60fae2 commit 9b5e30c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Bug fixes
44

55
* Fix ContextualVersionConflict in Dockerfile.spark. Thanks Linan Zheng, @LinanZheng
6+
* Fix Info Subcommand in RemoteSparkMagic. Thanks Linan Zheng, @LinanZheng
67

78
## 0.15.0
89

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)

0 commit comments

Comments
 (0)