Skip to content

Commit

Permalink
Fix Bug When Importing Roundtrip (#127)
Browse files Browse the repository at this point in the history
* Add optional argument to avoid error message

* Flip import sequence to avoid importing roundtrip if IPython verison not sufficient

* Black

* Change function signature for futureproofing

---------

Co-authored-by: Michael Richard Mckinsey <[email protected]>
Co-authored-by: Michael Richard Mckinsey <[email protected]>
  • Loading branch information
3 people authored May 24, 2024
1 parent 324e35b commit 310cd6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions hatchet/external/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ class VersionError(Exception):


try:
from .roundtrip.roundtrip.manager import Roundtrip
import IPython

# Refrencing Roundtrip here to resolve scope issues with import
Roundtrip

# Testing IPython version
if int(IPython.__version__.split(".")[0]) > 7:
raise VersionError()

from .roundtrip.roundtrip.manager import Roundtrip

# Refrencing Roundtrip here to resolve scope issues with import
Roundtrip

except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion hatchet/external/roundtrip/roundtrip/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def var_to_js(
js_to_py_converter=from_js_converter,
)

def manage_jupter_change(self):
def manage_jupter_change(self, *args, **kwargs):
"""
Callback function which runs after a cell is executed.
Expand Down

0 comments on commit 310cd6c

Please sign in to comment.