Skip to content
forked from pydata/xarray

Commit

Permalink
Escaping dtypes (pydata#3444)
Browse files Browse the repository at this point in the history
* Escaping dtypes

* Reformatting
  • Loading branch information
jsignell authored and shoyer committed Oct 24, 2019
1 parent ba48fbc commit bb0a5a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/core/formatting_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def summarize_variable(name, var, is_index=False, dtype=None, preview=None):
cssclass_idx = " class='xr-has-index'" if is_index else ""
dims_str = f"({', '.join(escape(dim) for dim in var.dims)})"
name = escape(name)
dtype = dtype or var.dtype
dtype = dtype or escape(str(var.dtype))

# "unique" ids required to expand/collapse subsections
attrs_id = "attrs-" + str(uuid.uuid4())
Expand Down
2 changes: 2 additions & 0 deletions xarray/tests/test_formatting_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ def test_repr_of_dataset(dataset):
assert (
formatted.count("class='xr-section-summary-in' type='checkbox' checked>") == 3
)
assert "<U4" in formatted
assert "<IA>" in formatted

0 comments on commit bb0a5a2

Please sign in to comment.