<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic displayHTML can't seem to be used from Python code, only hand typed into a cell??? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19646#M13194</link>
    <description>&lt;P&gt;Trying to use displayHTML from w/in a Python module gets a Python exception:&lt;/P&gt;&lt;P&gt;NameError: name 'displayHTML' is not defined&lt;/P&gt;&lt;P&gt;and I've found no way around this. It seems to be something at the UI layer or something, not a Python function that can be referenced/imported or accessed/used from w/in code. Other notebooks provide methods for rendering HTML from w/in Python modules running in the notebook. The Ipython display/HTML methods don't work. Is there a Python function that will render HTML?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are a couple external issue I found:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/71474139/how-to-import-displayhtml-in-databricks" target="test_blank"&gt;https://stackoverflow.com/questions/71474139/how-to-import-displayhtml-in-databricks&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/sassoftware/saspy/issues/462" target="test_blank"&gt;https://github.com/sassoftware/saspy/issues/462&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 19:31:51 GMT</pubDate>
    <dc:creator>T_1</dc:creator>
    <dc:date>2022-05-25T19:31:51Z</dc:date>
    <item>
      <title>displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19646#M13194</link>
      <description>&lt;P&gt;Trying to use displayHTML from w/in a Python module gets a Python exception:&lt;/P&gt;&lt;P&gt;NameError: name 'displayHTML' is not defined&lt;/P&gt;&lt;P&gt;and I've found no way around this. It seems to be something at the UI layer or something, not a Python function that can be referenced/imported or accessed/used from w/in code. Other notebooks provide methods for rendering HTML from w/in Python modules running in the notebook. The Ipython display/HTML methods don't work. Is there a Python function that will render HTML?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are a couple external issue I found:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/71474139/how-to-import-displayhtml-in-databricks" target="test_blank"&gt;https://stackoverflow.com/questions/71474139/how-to-import-displayhtml-in-databricks&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/sassoftware/saspy/issues/462" target="test_blank"&gt;https://github.com/sassoftware/saspy/issues/462&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 19:31:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19646#M13194</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2022-05-25T19:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19647#M13195</link>
      <description>&lt;P&gt;@Tom Weber​&amp;nbsp;please check if the below docs help you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/notebooks/visualizations/html-d3-and-svg.html" target="test_blank"&gt;https://docs.databricks.com/notebooks/visualizations/html-d3-and-svg.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/databricks//notebooks/visualizations/#--displayhtml-function" target="test_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks//notebooks/visualizations/#--displayhtml-function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 16:20:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19647#M13195</guid>
      <dc:creator>Prabakar</dc:creator>
      <dc:date>2022-05-27T16:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19648#M13196</link>
      <description>&lt;P&gt;Hey, thanks for reaching out. Unfortunately no, those don't help at all. I know the displayHTML call is the way a user renders HTML themselves by typing it into a cell. The problem is that that function doesn't exist in Python such that it can be executed by imported modules running in that environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I support a module users use which can provide results that are returned as HTML and, in other notebooks, rendered using the appropriate function for those environments, from my code; the user doesn't have to get the HTML object and manually render it themselves. That doesn't work in this notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to call that from w/in a module results in a NameError exception and I can find no way to get this function available in my module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NameError: name 'displayHTML' is not defined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I didn't put all the info in here; the links to the issues had all that so I didn't dump it all in here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But again, I appreciate you replying. Have any ideas about using it from w/in an imported module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 16:44:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19648#M13196</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2022-05-27T16:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19649#M13197</link>
      <description>&lt;P&gt;So is there really no way for Python code executing in a notebook (in a cell) to render HTML? It can only be done by an end user typing in displayHTML() themselves in a cell (passing in a string of HTML)? Other notebooks (Jupyter, Zeppelin) have functions for rendering HTML too, but code can call it (and it renders), or users can invoke it themselves too. Is there any way for executing Python code to render HTML in databricks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 18:09:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19649#M13197</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2022-06-13T18:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19650#M13198</link>
      <description>&lt;P&gt;Hello @Tom Weber​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the displayHTML function works in Python. Can you give it a try?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1826iF14D2BB8487D3A7E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 11:36:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19650#M13198</guid>
      <dc:creator>User16764241763</dc:creator>
      <dc:date>2022-06-16T11:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19651#M13199</link>
      <description>&lt;P&gt;I'm guessing that's just the same as typing it into a cell in a python notebook in the first place? Which obviously works. Executing it from inside a Python module is what doesn't work. Hope this picture comes through, and again, thanks for responding and trying to help. Hope this makes it more clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1832iD7F5CD53304C69D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 15:09:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19651#M13199</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2022-06-16T15:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19652#M13200</link>
      <description>&lt;P&gt;So, still trying to get an answer on how code executing on behalf of what a user typed into a cell (they called a method from my package) can render HTML. Is there really no way for this to work in databricks? This works in Jupyter and Zeppelin, though they each have their own methods that have to be used (but they exist and I use them) Does databricks have no way for code to render HTML for a cell? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 20:42:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/19652#M13200</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2023-05-02T20:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50203#M28731</link>
      <description>&lt;P&gt;I am facing exactly the same issue. Any progress?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 17:24:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50203#M28731</guid>
      <dc:creator>ptweir</dc:creator>
      <dc:date>2023-10-31T17:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50204#M28732</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/92700"&gt;@ptweir&lt;/a&gt;&amp;nbsp;, I'm afraid I've not even gotten anyone to reply who understands the problem. Looking back, looks like I opened this a year and a half ago. I'm not sure if databricks developers monitor this; it seems to be a users helping users forum. We have one of those too, but I try to keep up with it since most of our users aren't really github types. So, I try to help on any channel they may use. I can't find anything that goes directly to databricks folks. So, no, I've gotten nothing on this. Sorry you're stuck on this too. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 17:46:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50204#M28732</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2023-10-31T17:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50205#M28733</link>
      <description>&lt;P&gt;Looks like this works!&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from IPython.display import HTML, display
from IPython import get_ipython
try:
   shell = get_ipython().__class__.__name__
   if shell == 'DatabricksShell':
       display(HTML(html_string))&lt;/LI-CODE&gt;&lt;P&gt;kudos to this stackoverflow answer:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/71474139/how-to-import-displayhtml-in-databricks" target="_blank"&gt;https://stackoverflow.com/questions/71474139/how-to-import-displayhtml-in-databricks&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 17:51:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50205#M28733</guid>
      <dc:creator>ptweir</dc:creator>
      <dc:date>2023-10-31T17:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50207#M28735</link>
      <description>&lt;P&gt;I'm using it in a python package &lt;A href="https://github.com/ptweir/datura/blob/main/datura/draw.py#L20C14-L20C14" target="_self"&gt;here&lt;/A&gt; and just tested that it works in databricks.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 17:57:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50207#M28735</guid>
      <dc:creator>ptweir</dc:creator>
      <dc:date>2023-10-31T17:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50208#M28736</link>
      <description>&lt;P&gt;Interesting, that's just the Jupyter way to render HTML, which is my default. That didn't work back then, else I'd have never had an issue to start with! So, maybe they've realized the problem and fixed it silently? Well, I'm going to try to connect and test this out, but I'm still skeptical. But that's just my nature :). I'll post back after I can give this a try! If it's finally fixed, then that's great! I'll let you know ...&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 18:03:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50208#M28736</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2023-10-31T18:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50210#M28737</link>
      <description>&lt;P&gt;Holy Guacamole Batman! It works finally!!!! Wow, thanks&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/92700"&gt;@ptweir&lt;/a&gt;&amp;nbsp;That's awesome! I can go back and update my doc (and code, to just use databricks the same, now, and Jupyter!) and it'll work by default. It's great they fixed it, shame they never told us. But I'll take the fix!&lt;/P&gt;&lt;P&gt;Thanks again for reaching out on this, that's great!&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="New Bitmap Image.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/4652i774212F11A274073/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="New Bitmap Image.png" alt="New Bitmap Image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 18:23:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50210#M28737</guid>
      <dc:creator>T_1</dc:creator>
      <dc:date>2023-10-31T18:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: displayHTML can't seem to be used from Python code, only hand typed into a cell???</title>
      <link>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50215#M28739</link>
      <description>&lt;P&gt;Yay!!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 19:30:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/displayhtml-can-t-seem-to-be-used-from-python-code-only-hand/m-p/50215#M28739</guid>
      <dc:creator>ptweir</dc:creator>
      <dc:date>2023-10-31T19:30:09Z</dc:date>
    </item>
  </channel>
</rss>

