Skip to content

Commit

Permalink
fix: correctly visualize array type
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-kwitt authored and cpcloud committed Jan 21, 2023
1 parent 506ce01 commit 26b0b3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ibis/expr/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def get_label(node):
label_fmt = '<<I>{}</I>: <B>{}</B>{}>'
else:
label_fmt = '<<I>{}</I>: <B>{}</B><BR ALIGN="LEFT" />:: {}>'
label = label_fmt.format(escape(nodename), escape(name), typename)
label = label_fmt.format(escape(nodename), escape(name), escape(typename))
else:
if isinstance(node, ops.TableNode):
label_fmt = '<<B>{}</B>{}>'
else:
label_fmt = '<<B>{}</B><BR ALIGN="LEFT" />:: {}>'
label = label_fmt.format(escape(name), typename)
label = label_fmt.format(escape(name), escape(typename))
return label


Expand Down
6 changes: 6 additions & 0 deletions ibis/tests/expr/test_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,9 @@ def test_html_escape(with_graphviz):
# representation. If an error is thrown, _repr_png_ returns None.
expr = ibis.table([('<a & b>', ibis.expr.datatypes.Array('string'))])
assert expr._repr_png_() is not None

expr = ibis.array([1, 2, 3])
assert expr._repr_png_() is not None

expr = ibis.array([1, 2, 3]).name("COL")
assert expr._repr_png_() is not None

0 comments on commit 26b0b3f

Please sign in to comment.