cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle <IPython.core.display.HTML object>

marsjuli
New Contributor II

Some libraries have intermediate IPython HTML-objects returned to the notebook cell output.

Since this happens during training a machine learning model the statements are typically buried within in the library so I cannot easily interfere. (e.g. in order overwrite the output statement to use the databricks function display() )

Is there - or will there be - an option to handle HTML-objects from IPython ?

Examplary versions:

DB-Runtime 10.0 ML (occurs in 8.X and 9.X as well)

ipython 7.22.0

ipython-genutils0.2.0

tqdm 4.59.0

mlflow 1.20.2

transformers 4.9.2

Example Output:

grafik.png

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager
5 REPLIES 5

Kaniz
Community Manager
Community Manager

Hi @ marsjuli! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers in the community have an answer to your question first. Or else I will get back to you soon. Thanks.

Kaniz
Community Manager
Community Manager

Hi @Julian Marstaller​ , ​ 

This link shall help you:- https://docs.databricks.com/notebooks/visualizations/html-d3-and-svg.html

marsjuli
New Contributor II

Hi @Kaniz Fatma​ ,

thanks for showing me the link. This helps if you are in control of the generated html-object. If the html-content comes from a library, that is where the problems start, because I cannot wrap displayHTML().

(I can of course look for that line and rebuild my own databricks-compatible version of the lib, but this would be improvisation, not solving the issue)

I am just worried that the number of python libraries will increase that use html-objects deep down. Surely there can be a way to capture this in the stack and handle it better than enforcing a call on another display method. I am sure this needs to be coordinated with the frontend developers of the databricks UI and the backend devs doing the Python-engine.

Is it possible to add such a configuration for a specific function of a library instead?

https://github.com/databrickslabs/jupyterlab-integration/blob/753882c37ead89013f302863d1548eef27e0ba...

Kaniz
Community Manager
Community Manager

Hi @Julian Marstaller​ , This won't work in the Databricks notebooks.

Kaniz
Community Manager
Community Manager

Hi @Julian Marstaller​ , Can you please post your code snap here?

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!