From 40bf6437d791081204989c04c415c77eba56f1e0 Mon Sep 17 00:00:00 2001 From: Daniel Thom Date: Thu, 4 Dec 2025 13:15:11 -0700 Subject: [PATCH 1/3] Update installation instructions --- README.md | 4 ++-- docs/how_tos/getting_started/installation.md | 3 ++- docs/how_tos/spark_backend.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 83c9303..5dbb49f 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ $ pip install chronify To use Apache Spark via Apache Thrift Server as the backend: ``` -$ pip install chronify --group=pyhive +$ pip install "chronify[spark]"" ``` ## Developer installation ``` -$ pip install -e ".[dev]" --group=pyhive +$ pip install -e ".[dev,spark]" ``` Please install `pre-commit` so that your code is checked before making commits. diff --git a/docs/how_tos/getting_started/installation.md b/docs/how_tos/getting_started/installation.md index ab922a7..398dce1 100644 --- a/docs/how_tos/getting_started/installation.md +++ b/docs/how_tos/getting_started/installation.md @@ -38,9 +38,10 @@ To use DuckDB or SQLite as the backend: ``` To use Apache Spark via Apache Thrift Server as the backend, you must install pyhive. +This command will install the necessary dependencies. ```{eval-rst} .. code-block:: console - $ pip install chronify --group=pyhive + $ pip install "chronify[spark]" ``` diff --git a/docs/how_tos/spark_backend.md b/docs/how_tos/spark_backend.md index 1df45c6..5e893bf 100644 --- a/docs/how_tos/spark_backend.md +++ b/docs/how_tos/spark_backend.md @@ -4,7 +4,7 @@ scripts for UNIX operating systems (not Windows). ## Install chronify with Spark support ``` -$ pip install chronify --group=pyhive +$ pip install "chronify[spark]" ``` ## Installation on a development computer From dfe8674ed9c20d1c324ef6ab7e84851ff94463bb Mon Sep 17 00:00:00 2001 From: Daniel Thom Date: Wed, 17 Dec 2025 18:12:59 -0700 Subject: [PATCH 2/3] Fix clock-time-aligned timestamp generation for timezones with offset changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When start_time_is_tz_naive() is True (indicating clock-time-aligned data), the _list_timestamps method was incorrectly replacing the start time's tzinfo with each timezone and then iterating in UTC. This caused incorrect timestamps for dates after historical timezone offset changes. For example, Algeria changed from UTC+0 to UTC+1 on April 25, 1980. With the old code, timestamps after this date would be generated at 01:00:00 instead of the expected 00:00:00, because: 1. Start (1980-01-01 00:00:00) was tagged with Africa/Algiers timezone 2. At that date, Africa/Algiers was UTC+0, so start = 1980-01-01 00:00:00 UTC 3. Iteration added days in UTC: 1980-04-25 00:00:00 UTC 4. Converting back to local time after the offset change: 1980-04-25 01:00:00 For clock-time-aligned data, all timezones should have the same clock times (e.g., midnight everywhere). The fix passes start=None when the start time is tz-naive, which causes _iter_timestamps to use the naive iteration path (start + i * resolution) without any timezone conversion. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/chronify/datetime_range_generator.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/chronify/datetime_range_generator.py b/src/chronify/datetime_range_generator.py index b030e68..87574f4 100644 --- a/src/chronify/datetime_range_generator.py +++ b/src/chronify/datetime_range_generator.py @@ -120,10 +120,9 @@ def __init__( def _list_timestamps(self, time_zone: Optional[tzinfo]) -> list[datetime]: """always return tz-naive timestamps relative to input time_zone""" if self._model.start_time_is_tz_naive(): - if time_zone: - start = self._model.start.replace(tzinfo=time_zone) - else: - start = None + # For clock-time-aligned data, iterate naively without timezone conversion. + # All timezones get the same clock times (e.g., midnight everywhere). + start = None else: if time_zone: start = self._model.start.astimezone(time_zone) From c9023a96f5918e86e79b6e900530a5477d2ccec3 Mon Sep 17 00:00:00 2001 From: Daniel Thom Date: Wed, 17 Dec 2025 21:37:07 -0700 Subject: [PATCH 3/3] Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5dbb49f..ac08053 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ $ pip install chronify To use Apache Spark via Apache Thrift Server as the backend: ``` -$ pip install "chronify[spark]"" +$ pip install "chronify[spark]" ``` ## Developer installation