Default weekly report to monday

closes #8502
This commit is contained in:
Matthias 2023-04-17 20:20:38 +02:00
parent 362974b831
commit 7ff35fea3c
2 changed files with 3 additions and 2 deletions

View File

@ -273,7 +273,8 @@ def _get_resample_from_period(period: str) -> str:
if period == 'day':
return '1d'
if period == 'week':
return '1w'
# Weekly defaulting to Monday.
return '1W-MON'
if period == 'month':
return '1M'
raise ValueError(f"Period {period} is not supported.")

View File

@ -465,7 +465,7 @@ def test_generate_periodic_breakdown_stats(testdatadir):
def test__get_resample_from_period():
assert _get_resample_from_period('day') == '1d'
assert _get_resample_from_period('week') == '1w'
assert _get_resample_from_period('week') == '1W-MON'
assert _get_resample_from_period('month') == '1M'
with pytest.raises(ValueError, match=r"Period noooo is not supported."):
_get_resample_from_period('noooo')