Combiz Khozoie

01/24/2023, 5:59 PM
It's possible to preview materialized jupyter notebooks inside dagit, which is great. Is this possible for other filetypes also, e.g. pdf files or html reports?
❤️ 1


01/24/2023, 9:01 PM
you can add metadata to the asset output. MetadataValue can take a notebook path and render it in the asset metadata section (apidoc). or, you could also try make it show up as markdown (apidoc) example of how to add metadata to asset output: and it’d show up similar to this:
🙏 1

Peter Davidson

01/25/2023, 6:08 AM
a workaround i did for this was to add a line in the IOManager I use, so that when the ipynb is written to file, then it is also written as an html with this extra line:
os.system(f'jupyter nbconvert --to html "{output_notebook_path}"')
Then I add the path to the notebook as metadata to the asset.
metadata = {
    "Executed notebook": MetadataValue.notebook(output_notebook_path),
    "HTML output": MetadataValue.url(pathlib.Path(str(output_notebook_path).replace(".ipynb", ".html")).as_uri())
But, you can't click the url to the html -> think this is blocked somehow in dagster. so need to copy/paste the link. Still, pretty good
🙏 1

Combiz Khozoie

01/25/2023, 10:35 AM
Great, thank you both