-
Notifications
You must be signed in to change notification settings - Fork 28
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
chore: Remove deprecated utcnow fn #757
Conversation
unit tests failing - can re-review when they're passing
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
❌ 10 Tests Failed:
View the top 3 failed tests by shortest run timeupload.tests.test_upload.UploadHandlerAzureTokenlessTest�test_azure_wrong_build_number upload.tests.test_upload.UploadHandlerGithubActionsTokenlessTest�test_underscore_replace upload.tests.test_upload.UploadHandlerTravisTokenlessTest�test_success To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time. ❌ Failed Test Results:Completed 2258 tests with View the full list of failed testspytest
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #757 +/- ##
================================================
+ Coverage 96.11000 96.16000 +0.05000
================================================
Files 815 814 -1
Lines 18442 18478 +36
================================================
+ Hits 17725 17770 +45
+ Misses 717 708 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -1,4 +1,4 @@ | |||
from datetime import datetime, timedelta | |||
from datetime import UTC, datetime, timedelta |
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.
I don’t see this import being used.
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.
Removed in 4eb66ea, thanks!
Purpose/Motivation
Saw there was a python warning in my IDE that utcnow is a deprecated function
Related blog post from late 2023 -- https://blog.miguelgrinberg.com/post/it-s-time-for-a-change-datetime-utcnow-is-now-deprecated
correct way now is to use .now(UTC) instead; all the changes in this PR are basically just find and replace and import UTC when necessary
Relevant stackoverflow post: https://stackoverflow.com/questions/15307623/cant-compare-naive-and-aware-datetime-now-challenge-datetime-end for why we had to chain .replace(tzinfo=None) to some calls
Links to relevant tickets
What does this PR do?
Remove deprecation warnings related to utcnow()
Notes to Reviewer
Anything to note to the team? Any tips on how to review, or where to start?
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.