Skip to content

Conversation

@daniel-thom
Copy link
Collaborator

Refer to the commit message

daniel-thom and others added 2 commits December 4, 2025 13:15
… changes

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 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a time check logic issue in the datetime range generator and updates installation commands throughout the documentation to use the correct pip extras syntax.

  • Simplifies timezone-naive start time handling in DatetimeRangeGeneratorExternalTimeZone._list_timestamps() by removing conditional logic
  • Updates installation commands from incorrect --group=pyhive syntax to proper pip extras syntax "chronify[spark]"
  • Adds clarifying comment explaining clock-time-aligned behavior for timezone-naive data

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/chronify/datetime_range_generator.py Simplifies timezone-naive start time handling by always setting start to None instead of conditionally applying timezone
docs/how_tos/spark_backend.md Corrects Spark installation command to use proper pip extras syntax
docs/how_tos/getting_started/installation.md Updates installation instructions with correct syntax and adds explanatory text
README.md Updates both user and developer installation commands to use correct pip extras syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.29%. Comparing base (7df2f95) to head (c9023a9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
- Coverage   51.30%   51.29%   -0.01%     
==========================================
  Files          57       57              
  Lines       12592    12590       -2     
==========================================
- Hits         6460     6458       -2     
  Misses       6132     6132              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants