Skip to content

Commit

Permalink
minor fix: Tables integration caused method ambiguation for Union{}[] (
Browse files Browse the repository at this point in the history
  • Loading branch information
16bitmood authored Jan 30, 2022
1 parent 7c16080 commit 0e4cc35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/runner/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,7 @@ const integrations = Integration[
pluto_showable(::MIME"application/vnd.pluto.table+object", t::Type) = false
pluto_showable(::MIME"application/vnd.pluto.table+object", t::AbstractVector{<:NamedTuple}) = false
pluto_showable(::MIME"application/vnd.pluto.table+object", t::AbstractVector{<:Dict{Symbol,<:Any}}) = false
pluto_showable(::MIME"application/vnd.pluto.table+object", t::AbstractArray{Union{}, 1}) = false

end,
),
Expand Down
5 changes: 5 additions & 0 deletions test/RichOutput.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ import Pluto: update_run!, WorkspaceManager, ClientSession, ServerSession, Noteb
(a=16, b=16,)
(a=16, b=16,)
]"""),
Cell("Union{}[]"),
])
fakeclient.connected_notebook = notebook

Expand All @@ -242,6 +243,7 @@ import Pluto: update_run!, WorkspaceManager, ClientSession, ServerSession, Noteb
@test notebook.cells[14].output.mime isa MIME"application/vnd.pluto.tree+object"
@test notebook.cells[15].output.mime isa MIME"application/vnd.pluto.tree+object"
@test notebook.cells[16].output.mime isa MIME"application/vnd.pluto.tree+object"
@test notebook.cells[17].output.mime isa MIME"application/vnd.pluto.tree+object"
@test notebook.cells[2].output.body isa Dict
@test notebook.cells[3].output.body isa Dict
@test notebook.cells[4].output.body isa Dict
Expand All @@ -255,11 +257,14 @@ import Pluto: update_run!, WorkspaceManager, ClientSession, ServerSession, Noteb
@test notebook.cells[14].output.body isa Dict
@test notebook.cells[15].output.body isa Dict
@test notebook.cells[16].output.body isa Dict
@test notebook.cells[17].output.body isa Dict
@test occursin("String?", string(notebook.cells[13].output.body)) # Issue 1490.

@test notebook.cells[10].output.mime isa MIME"text/plain"
@test notebook.cells[10].errored == false

@test notebook.cells[17].errored == false # Issue 1815

# to see if we truncated correctly, we convert the output to string and check how big it is
# because we don't want to test too specifically
roughsize(x) = length(string(x))
Expand Down

0 comments on commit 0e4cc35

Please sign in to comment.