Skip to content

Commit

Permalink
fix: table template ignoring text format (ydataai#1462)
Browse files Browse the repository at this point in the history
* fix: table template ignoring text format

* fix: timeseries unit test

* fix(linting): code formatting

---------

Co-authored-by: Azory YData Bot <[email protected]>
  • Loading branch information
2 people authored and maciejb committed Oct 3, 2023
1 parent edf9098 commit 6592bfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<tr{% if 'alert' in row and row['alert'] %} class="alert"{% endif %}>
<th>{{ row['name'] }}</th>
{% if row['value'].__class__.__name__ == 'list' %}
{% for value in row['value'] %}
<td>{{ value }}{% if loop.last and 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
{% for value in row['value'] +%}
<td style="white-space:pre white-space:nowrap">{{ value }}{% if loop.last and 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
{% endfor %}
{% else %}
<td>{{ row['value'] }}{% if 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
<td style="white-space:pre white-space:nowrap">{{ row['value'] }}{% if 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
{% endif %}
</tr>
{% endfor %}
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def html_profile() -> str:
def test_timeseries_identification(html_profile: str):
assert "<th>TimeSeries</th>" in html_profile, "TimeSeries not detected"
assert (
"<tr><th>TimeSeries</th><td>8</td></tr>" in html_profile
'<tr><th>TimeSeries</th><td style="white-space:pre white-space:nowrap">8</td></tr>'
in html_profile
), "TimeSeries incorrectly identified"


Expand Down

0 comments on commit 6592bfd

Please sign in to comment.