-
Notifications
You must be signed in to change notification settings - Fork 457
fix get unique timezones #896
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?
Conversation
155d83e
to
aabbaad
Compare
Please run pre-commit on |
@cclauss updated |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #896 +/- ##
==========================================
- Coverage 88.19% 87.99% -0.20%
==========================================
Files 32 32
Lines 1008 1008
Branches 105 105
==========================================
- Hits 889 887 -2
- Misses 101 102 +1
- Partials 18 19 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@alirafiei75 please take a look |
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 an issue with retrieving unique timezones from the CrontabSchedule by updating the query logic and the corresponding test.
- Updated the scheduler method to use _get_unique_timezones instead of _get_unique_timezone_names.
- Added a unit test to ensure that the unique timezone retrieval returns the expected distinct timezones.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
t/unit/test_schedulers.py | Adds a unit test validating that unique timezones are correctly returned. |
django_celery_beat/schedulers.py | Updates the unique timezone query and removes the old method. |
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.
can we get additional tests for this?
@auvipy can you suggest what additional tests you want here? |
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.
there are failing tests now, can you fix them?
the previous query did not actually get distinct timezones
The rebase didn’t work. Please make it errorless again |
this tested for string timezones, which were not possible
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.
Why are we removing the tests?
it's the same test as the one below |
@@ -1663,31 +1678,6 @@ def setup_method(self): | |||
def teardown_method(self): | |||
patch.stopall() | |||
|
|||
@patch("django_celery_beat.schedulers.aware_now") |
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.
can we add more tests which also improve the test coverage? and there is no regression introduced?
if you're referring to the codecov note, then i would guess it's b/c the tests only run with sqlite. can you confirm? if so, i don't have have the bandwidth to update the test suite to also run a build with non-sqlite (eg. postgres). i can remove the sqlite/non-sqlite conditional in that code even though it'll be less performant, but i think it'll increase the codecov by virtue of not having a non-tested branch re: regressions, there are existing tests from the original PR that introduced this change that should cover regressions. this change is a performance improvement |
the previous query did not actually get distinct timezones