8000 Fix DeprecationWarning: avoid use of datetime.utcfromtimestamp by osma · Pull Request #848 · NatLibFi/Annif · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix DeprecationWarning: avoid use of datetime.utcfromtimestamp #848

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

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

osma
Copy link
Member
@osma osma commented Apr 7, 2025

This PR fixes a DeprecationWarning in backend/backend.py:

  /home/oisuomin/git/Annif/annif/backend/backend.py:74: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    datetime.utcfromtimestamp(os.path.getmtime(p))

The modification_time property has been modified to avoid the use of datetime.utcfromtimestamp which is going away in the future.

@osma osma added this to the 1.4 milestone Apr 7, 2025
@osma osma self-assigned this Apr 7, 2025
Copy link
sonarqubecloud bot commented Apr 7, 2025

Copy link
codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.63%. Comparing base (38f5e8a) to head (f55f065).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #848      +/-   ##
==========================================
- Coverage   99.63%   99.63%   -0.01%     
==========================================
  Files          99       99              
  Lines        7350     7348       -2     
==========================================
- Hits         7323     7321       -2     
  Misses         27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osma osma merged commit bf802c7 into main Apr 7, 2025
17 checks passed
@osma osma deleted the fix-backend-utcfromtimestamp-warning branch April 7, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0