Skip to content

Commit 574ebd2

Browse files
authored
SEOD-811. Make filtering of date totals in highcharts more flexible (#369)
1 parent 83da334 commit 574ebd2

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Changelog is organized by the version of this library, commit date and main poin
88

99
2023 September
1010

11+
#### [8.0.4] - 2023-11-06
12+
Make removal of date total when generating highcharts more flexible by localizing the datetime when filtering out the totals. This will work with timezone aware datetimes as well not aware ones.
13+
1114
#### [8.0.3] - 2023-09-06
1215
- Specify extras dependencies correctly
1316

fireant/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ def __hash__(self) -> int:
5555
Term.__hash__ = __hash__
5656

5757

58-
__version__ = "8.0.0"
58+
__version__ = "8.0.4"

fireant/widgets/highcharts.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,12 @@ def _remove_date_totals(data_frame: pd.DataFrame) -> pd.DataFrame:
635635
if isinstance(data_frame.index, pd.MultiIndex):
636636
first_index = data_frame.index.get_level_values(0)
637637
if isinstance(first_index, pd.DatetimeIndex):
638-
index_slice = first_index < TS_UPPER_BOUND
638+
index_slice = first_index.tz_localize(None) < TS_UPPER_BOUND
639639
return data_frame.loc[index_slice, :]
640640

641-
elif isinstance(data_frame.index, pd.DatetimeIndex):
642-
return data_frame[data_frame.index < TS_UPPER_BOUND]
641+
if isinstance(data_frame.index, pd.DatetimeIndex):
642+
index_slice = data_frame.index.tz_localize(None) < TS_UPPER_BOUND
643+
return data_frame[index_slice]
643644

644645
return data_frame
645646

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fireant"
3-
version = "8.0.3"
3+
version = "8.0.4"
44
description = ""
55
authors = ["Ąžuolas Krušna <akrusna@kayak.com>"]
66
readme = "README.rst"

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 8.0.3
2+
current_version = 8.0.4
33
commit = True
44
tag = True
55

0 commit comments

Comments
 (0)