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

improvement: patch IPython.display.display to call mo.output.append #919

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

akshayka
Copy link
Contributor

@akshayka akshayka commented Mar 6, 2024

This improves compatibility with code written for IPython.

Additionally, this adds a formatter for IPython.display.HTML -- we already some display.HTML objects by special casing _repr_html_, but this adds support for URLs. However, iframe'd URLs are not resizing; left a TODO.

Smoke test:

image

Copy link

vercel bot commented Mar 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2024 0:11am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2024 0:11am

html: IPython.display.HTML,
) -> tuple[KnownMimeType, str]:
if html.url is not None:
# TODO(akshayka): resize iframe not working
Copy link
Contributor

Choose a reason for hiding this comment

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

this wont work for CORS - not sure if thats what you were testing, but that would be once reason.

if you do same origin, it should work. you could make marimo a proxy for URLs (but i think that could be done later)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah i see. will put off for later. embedding urls is likely not a common use case

@@ -194,6 +195,7 @@ exclude = [
'marimo/_tutorials/',
'marimo/_smoke_tests/',
]
warn_unused_ignores=false
Copy link
Contributor

Choose a reason for hiding this comment

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

ahhhhh! this was the worst without this since you couldn't do a blanket ignore b/c in another test matrix it would fail. and other matrices would have different ignores..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

haha yea it was getting really cumbersome

@akshayka akshayka merged commit 04f628e into main Mar 7, 2024
29 checks passed
@akshayka akshayka deleted the aka/ipython-display-display branch March 7, 2024 00:16
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants