Skip to content

Commit

Permalink
SEOD-811. Make filtering of date totals in highcharts more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
AzisK committed Nov 7, 2023
1 parent 83da334 commit d970d29
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Changelog is organized by the version of this library, commit date and main poin

2023 September

#### [8.0.4] - 2023-11-06
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.

#### [8.0.3] - 2023-09-06
- Specify extras dependencies correctly

Expand Down
2 changes: 1 addition & 1 deletion fireant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def __hash__(self) -> int:
Term.__hash__ = __hash__


__version__ = "8.0.0"
__version__ = "8.0.4"
7 changes: 4 additions & 3 deletions fireant/widgets/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,12 @@ def _remove_date_totals(data_frame: pd.DataFrame) -> pd.DataFrame:
if isinstance(data_frame.index, pd.MultiIndex):
first_index = data_frame.index.get_level_values(0)
if isinstance(first_index, pd.DatetimeIndex):
index_slice = first_index < TS_UPPER_BOUND
index_slice = first_index.tz_localize(None) < TS_UPPER_BOUND
return data_frame.loc[index_slice, :]

elif isinstance(data_frame.index, pd.DatetimeIndex):
return data_frame[data_frame.index < TS_UPPER_BOUND]
if isinstance(data_frame.index, pd.DatetimeIndex):
index_slice = data_frame.index.tz_localize(None) < TS_UPPER_BOUND
return data_frame[index_slice]

return data_frame

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fireant"
version = "8.0.3"
version = "8.0.4"
description = ""
authors = ["Ąžuolas Krušna <[email protected]>"]
readme = "README.rst"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 8.0.3
current_version = 8.0.4
commit = True
tag = True

Expand Down

0 comments on commit d970d29

Please sign in to comment.