Skip to content

ENH Improves message for HTML repr when notebook is not trusted #21316

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

Merged
merged 7 commits into from
Oct 21, 2021

Conversation

thomasjpfan
Copy link
Member

When the HTML repr is shown in an jupyter notebook that is not trusted, one needs to rerun the cell or trust the notebook. This PR shows an improved message for when this happens:

This PR

Screen Shot 2021-10-12 at 3 59 58 PM

main

Screen Shot 2021-10-12 at 3 59 48 PM

@adrinjalali
Copy link
Member

Should we fall back to text output when it's not a trusted notebook?

@thomasjpfan
Copy link
Member Author

Should we fall back to text output when it's not a trusted notebook?

This PR already falls back to a text repr, with an additional message:

137021143-46e02c33-ac8f-4d80-9b06-c1237613ef3a

The biggest benefit of having the repr text in the HTML is that trusting the notebook will automatically display the HTML repr, because the HTML repr is still in the output.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM

@ogrisel ogrisel merged commit d5db197 into scikit-learn:main Oct 21, 2021
@glemaitre glemaitre mentioned this pull request Oct 23, 2021
10 tasks
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants