Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bug When Importing Roundtrip #127

Merged
merged 4 commits into from
May 24, 2024

Conversation

michaelmckinsey1
Copy link
Collaborator

@michaelmckinsey1 michaelmckinsey1 commented May 22, 2024

Currently, Hatchet prints a TypeError in each Jupyter cell due to a missing positional argument in manage_jupter_change() in hatchet/external/roundtrip/roundtrip/manager.py. By adding and optional positional argument to the function, we avoid the error when this line is ran.

Additionally, the import statements are re-arranged to avoid importing the roundtrip module unintentionally, which is happening in the below image.

image

@michaelmckinsey1 michaelmckinsey1 self-assigned this May 22, 2024
@michaelmckinsey1 michaelmckinsey1 added area-external Issues and PRs related to external libraries used by Hatchet priority-normal Normal priority issues and PRs status-ready-for-review This PR is ready to be reviewed by assigned reviewers type-bug Identifies bugs in issues and identifies bug fixes in PRs labels May 22, 2024
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cscully-allison I made a change here to the import, because roundtrip was being imported before checking the IPython.__version__. I think that is part of why the error happens.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is an IPython API issue, then yes.

By switching the order, the error should not occur at all.

@michaelmckinsey1 michaelmckinsey1 changed the title Add optional argument to avoid error message Fix Bug When Importing Roundtrip May 22, 2024
@pearce8 pearce8 requested a review from ilumsden May 24, 2024 16:07
@cscully-allison
Copy link
Collaborator

These look good to me. Not sure why the unit tests are failing, but I couldn't see any side effects this would case.

Copy link
Collaborator

@ilumsden ilumsden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I have one minor suggestion to make the event handler that you changed more flexible and resilient to future IPython API changes, but that suggestion is not strictly needed at this time.

Also, regarding the CI failing, the cause has to do with the fact that Python 3.7 is EOL. Since flake8 is created by the Python Software Foundation, they frequently change the code so that it's only guaranteed to work with the oldest non-EOL version of Python or above. As a result, flake8 now makes use of the "walrus operator" (i.e., :=) internally, which will cause errors when run under Python 3.7. I've fixed this CI error in #129 by bumping the Python version that we use for black and flake8 checks to 3.9. You can either rebase on top of #129 or copy the relevant changes.

hatchet/external/roundtrip/roundtrip/manager.py Outdated Show resolved Hide resolved
@ilumsden
Copy link
Collaborator

@michaelmckinsey1 please rebase on develop. @pearce8 just merged #129, so you should be able to pull in the CI fixes by rebasing.

@ilumsden ilumsden added status-ready-to-merge This PR has made all revisions and is ready to merge into the develop branch and removed status-ready-for-review This PR is ready to be reviewed by assigned reviewers labels May 24, 2024
@pearce8 pearce8 merged commit 310cd6c into LLNL:develop May 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-external Issues and PRs related to external libraries used by Hatchet priority-normal Normal priority issues and PRs status-ready-to-merge This PR has made all revisions and is ready to merge into the develop branch type-bug Identifies bugs in issues and identifies bug fixes in PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants