Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Next Release

## Bug Fixes

- Resolve indefinite hanging bug when connecting to livy via vscode-jupyter

## 0.23.0

### Bug Fixes
Expand Down
12 changes: 6 additions & 6 deletions autovizwidget/autovizwidget/tests/test_encodingwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def setup_function():
global df, encoding, ipywidget_factory, change_hook

records = [
{"buildingID": 0, "date": "6/1/13", "temp_diff": 12, "\u263A": True},
{"buildingID": 1, "date": "6/1/13", "temp_diff": 0, "\u263A": True},
{"buildingID": 2, "date": "6/1/14", "temp_diff": 11, "\u263A": True},
{"buildingID": 0, "date": "6/1/15", "temp_diff": 5, "\u263A": True},
{"buildingID": 1, "date": "6/1/16", "temp_diff": 19, "\u263A": True},
{"buildingID": 2, "date": "6/1/17", "temp_diff": 32, "\u263A": True},
{"buildingID": 0, "date": "6/1/13", "temp_diff": 12, "\u263a": True},
{"buildingID": 1, "date": "6/1/13", "temp_diff": 0, "\u263a": True},
{"buildingID": 2, "date": "6/1/14", "temp_diff": 11, "\u263a": True},
{"buildingID": 0, "date": "6/1/15", "temp_diff": 5, "\u263a": True},
{"buildingID": 1, "date": "6/1/16", "temp_diff": 19, "\u263a": True},
{"buildingID": 2, "date": "6/1/17", "temp_diff": 32, "\u263a": True},
]
df = pd.DataFrame(records)

Expand Down
3 changes: 3 additions & 0 deletions sparkmagic/sparkmagic/kernels/wrapperkernel/usercodeparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ def get_code_to_run(self, code):
return code
elif not code:
return code
elif "_VSCODE_" in code:
# Avoids sending VSCode-jupyter bootstrapping logic to livy
return code
else:
return "%%spark\n{}".format(code)
12 changes: 12 additions & 0 deletions sparkmagic/sparkmagic/tests/test_usercodeparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,15 @@ def test_unicode_in_double_magics():
assert "%%{}\nmy content è🐙\nmore content\n ".format(
magic_name
) == parser.get_code_to_run(cell)


def test_vscode_bootstrapping():
parser = UserCodeParser()
cell = """
from IPython import get_ipython

# Variable that prevent wrapping from happing more than_once
__VSCODE_wrapped_run_cell = False
"""

assert cell == parser.get_code_to_run(cell)