-
Notifications
You must be signed in to change notification settings - Fork 7
Fix time check #60
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
base: main
Are you sure you want to change the base?
Fix time check #60
Conversation
… 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>
There was a problem hiding this 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=pyhivesyntax 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Refer to the commit message