Page MenuHomeElementl

Add an HTML metadata entry type, allow JSON and HTML to be inlined into logs
AbandonedPublic

Authored by bengotow on Dec 16 2020, 6:39 AM.

Details

Reviewers
dish
prha
schrockn
Summary

This diff adds a new metadata entry type that provides a catch-all for users who want to display more interesting stuff in the log view. It was suggested in https://github.com/dagster-io/dagster/issues/3416 and seemed like it'd be useful, but I wouldn't object if we want to postpone this in favor of more codified graphing support later.

By default, HTML you provide is shown as [Show HTML] and the modal displays the content within a sandboxed iframe. If you pass inline=True, we trust you know what you're doing and allow the HTML to appear directly within the metadata entries table in the logs. This allows you to do cool stuff, but largely requires that your HTML snippet have a fully specified or immediately calculatable size and is fairly small. The screenshots below show it being used to embed an SVG with a bar chart, and a small image.

Inline=False:

Screen Shot 2020-12-16 at 12.31.30 AM.png (2×3 px, 1 MB)

Inline=True:

Screen Shot 2020-12-16 at 12.31.32 AM.png (2×3 px, 1 MB)

Screen Shot 2020-12-16 at 12.30.07 AM.png (2×3 px, 1 MB)

Test Plan

Run updated ManyEvents pipeline

Diff Detail

Repository
R1 dagster
Branch
bnabg/3416
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

bengotow edited the summary of this revision. (Show Details)

Apply constructor defaults for backwards compatibility with serialized data

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 16 2020, 7:09 AM
Harbormaster failed remote builds in B22952: Diff 27915!
  • Fix missing documentation

The inline option makes me very nervous, not gonna lie.

Thinking about if we would ever support this with an elementl-hosted service, and I think probably no??

I have fairly grave concerns about this. I think we open ourselves to a lot of chicanery.

Sounds good! Yeah I agree doing this on hosted dagit would be bad. There are a few improvements in this diff separate from the actual HTML / JSON / inlining feature and I'll pull those into a separate tiny diff here in a bit.