diff --git a/CHANGELOG.md b/CHANGELOG.md index 5057ff9d..bcf0ead2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/fireant/__init__.py b/fireant/__init__.py index 2a5a0801..48343422 100644 --- a/fireant/__init__.py +++ b/fireant/__init__.py @@ -55,4 +55,4 @@ def __hash__(self) -> int: Term.__hash__ = __hash__ -__version__ = "8.0.0" +__version__ = "8.0.4" diff --git a/fireant/widgets/highcharts.py b/fireant/widgets/highcharts.py index 6e573d6e..5523756f 100644 --- a/fireant/widgets/highcharts.py +++ b/fireant/widgets/highcharts.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 7f75bb1b..791b91e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireant" -version = "8.0.3" +version = "8.0.4" description = "" authors = ["Ąžuolas Krušna "] readme = "README.rst" diff --git a/setup.cfg b/setup.cfg index c778b2c6..fba65b8c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 8.0.3 +current_version = 8.0.4 commit = True tag = True