Open robbyki opened 2 years ago
Not quite the same thing as you were probably expecting, but this is how I do it in Databricks. Make the diagram available in DBFS FileStore, which can be accessed at /files/
. I didn't figure out how to render it from the local driver node.
os.chdir('/dbfs/FileStore')
with Diagram("", show=False, direction="TB", node_attr=node_attr) as diag:
with Cluster("Azure", graph_attr=graph_attr):
azdatalake = DataLake("\nData Lake\nStorage Gen2", )
databricks = Databricks("\nDatabricks")
synapse = SQLDatawarehouse("\nSynapse\nAnalytics")
azdatalake >> databricks
azdatalake >> synapse
with Cluster("AWS", graph_attr=graph_attr):
s3 = S3("\nS3")
databricks = Databricks("\nDatabricks")
redshift = Redshift("\nRedshift")
s3 >> databricks
s3 >> redshift
html = "<img src='/files/diagrams_image.png'>"
displayHTML(html)
Or with IPython
from IPython.display import Image
Image(url='/files/diagrams_image.png')
Thanks. This a decent workaround if there isn't a native solution yet.
Is there a certain trick to making the below code render inline in a databricks notebook? works fine in jupyter.