Skip to content

chore: fix wdc time assertion#80

Merged
sahiljhawar merged 1 commit into
mainfrom
fix-wdc-time
Jul 9, 2026
Merged

chore: fix wdc time assertion#80
sahiljhawar merged 1 commit into
mainfrom
fix-wdc-time

Conversation

@sahiljhawar

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 9, 2026 09:54
@sahiljhawar sahiljhawar merged commit 6a816e6 into main Jul 9, 2026
2 of 3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates WDC Dst time-range handling to normalize start_time/end_time to UTC before validating the requested interval, aiming to prevent timezone-related comparison issues.

Changes:

  • Normalize start_time and end_time via enforce_utc_timezone() before validation in download_and_process().
  • Replace the previous invalid-range ValueError handling in read() with an assertion after timezone normalization.
Comments suppressed due to low confidence (1)

swvo/io/dst/wdc.py:235

  • read() previously raised ValueError("start_time must be before end_time") when the time range was invalid (and the tests assert this). This change replaces it with an assert start_time < end_time, which (1) changes the exception type to AssertionError, (2) changes the allowed boundary condition (start==end used to be allowed), and (3) can be skipped entirely when Python is run with optimizations (-O). Keep the timezone normalization (to avoid naive/aware comparison errors), but restore the explicit ValueError check/message.
        start_time = enforce_utc_timezone(start_time)
        end_time = enforce_utc_timezone(end_time)

        assert start_time < end_time, "Start time must be before end time!"


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

@sahiljhawar sahiljhawar deleted the fix-wdc-time branch July 10, 2026 16:40
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.

2 participants