Skip to content

Commit 472c216

Browse files
alexbarrosazory-ydata
authored andcommitted
fix: table template ignoring text format (#1462)
* fix: table template ignoring text format * fix: timeseries unit test * fix(linting): code formatting --------- Co-authored-by: Azory YData Bot <azory@ydata.ai>
1 parent f04fb61 commit 472c216

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/ydata_profiling/report/presentation/flavours/html/templates/table.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
<tr{% if 'alert' in row and row['alert'] %} class="alert"{% endif %}>
1919
<th>{{ row['name'] }}</th>
2020
{% if row['value'].__class__.__name__ == 'list' %}
21-
{% for value in row['value'] %}
22-
<td>{{ value }}{% if loop.last and 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
21+
{% for value in row['value'] +%}
22+
<td style="white-space:pre white-space:nowrap">{{ value }}{% if loop.last and 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
2323
{% endfor %}
2424
{% else %}
25-
<td>{{ row['value'] }}{% if 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
25+
<td style="white-space:pre white-space:nowrap">{{ row['value'] }}{% if 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
2626
{% endif %}
2727
</tr>
2828
{% endfor %}

tests/unit/test_time_series.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def html_profile() -> str:
3737
def test_timeseries_identification(html_profile: str):
3838
assert "<th>TimeSeries</th>" in html_profile, "TimeSeries not detected"
3939
assert (
40-
"<tr><th>TimeSeries</th><td>8</td></tr>" in html_profile
40+
'<tr><th>TimeSeries</th><td style="white-space:pre white-space:nowrap">8</td></tr>'
41+
in html_profile
4142
), "TimeSeries incorrectly identified"
4243

4344

0 commit comments

Comments
 (0)