Skip to content

Conversation

@AnujNayak108
Copy link

Pull Request

Description

This PR refactors get_window to accept an optional reference_time
parameter (defaulting to now() in UTC).

This makes the function deterministic and easier to test, while
preserving existing behaviour for all current call sites.

A small unit test is added to validate the window calculation against a
fixed reference time.

Fixes #

How Has This Been Tested?

Added a unit test for get_window using a fixed reference time.
Verified locally by running:

uv run pytest src/quartz_api/internal/backends/test_utils.py

  • Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

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.

1 participant