Skip to content

Commit 7b0b946

Browse files
committed
owfeaturestatistics: Fix a error in 'rendering' time variables
1 parent e19a46a commit 7b0b946

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Orange/widgets/data/owfeaturestatistics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def render_value(value):
514514
return "∞"
515515

516516
str_val = attribute.str_val(value)
517-
if attribute.is_continuous:
517+
if attribute.is_continuous and not attribute.is_time:
518518
str_val = format_zeros(str_val)
519519

520520
return str_val

Orange/widgets/data/tests/test_owfeaturestatistics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _to_timestamps(years):
105105
# Time variable variations, windows timestamps need to be valid timestamps so
106106
# we'll just fill it in with arbitrary years
107107
time_full = VarDataPair(
108-
TimeVariable('time_full'),
108+
TimeVariable('time_full', have_date=True, have_time=True),
109109
np.array(_to_timestamps([2000, 2001, 2002, 2003, 2004]), dtype=float),
110110
)
111111
time_missing = VarDataPair(
@@ -117,7 +117,7 @@ def _to_timestamps(years):
117117
np.array(_to_timestamps([np.nan] * 5), dtype=float),
118118
)
119119
time_same = VarDataPair(
120-
TimeVariable('time_same'),
120+
TimeVariable('time_same', have_date=True, have_time=True),
121121
np.array(_to_timestamps([2004] * 5), dtype=float),
122122
)
123123
time = [

0 commit comments

Comments
 (0)