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: remove duplicate fields #925

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jeffeth-donaldson
Copy link

Description

This fixes an issue where the fields are duplicated on newer versions of jupyter.

Checklist

  • Wrote a description of my changes above
  • Formatted my code with black
  • Added a bullet point for my changes to the top of the CHANGELOG.md file
  • Added or modified unit tests to reflect my changes
  • Manually tested with a notebook
  • If adding a feature, there is an example notebook and/or documentation in the README.md file

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. kind:bug An unexpected error or issue with sparkmagic labels Jul 31, 2024
@devstein
Copy link
Collaborator

devstein commented Oct 9, 2024

Hey @jeffeth-donaldson thanks for opening a PR! Do you know why this code causes duplicate fields? How can we support older version of Jupyter as well?

@jeffeth-donaldson
Copy link
Author

Apologies, @devstein, I'm not terribly familiar with IPywidgets.

I believe the issue is that _repr_html_ is supposed to return an html string whereas here display was called which actually draws the widget to the screen.

I'm guessing in newer versions of Jupyter, the display method gets called recursively on the children already which is why the duplication occurs. I can see if returning all the children's html as a string works on older versions of Jupyter, however, I no longer require sparkmagic so I'm not sure how quickly I'll get around to it. I also do not know what version of Jupyter introduced this issue, so I'd have to figure that out for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug An unexpected error or issue with sparkmagic size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants