Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEOD-811. Make filtering of date totals in highcharts more flexible #369

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading