Skip to content

[18.0][FIX] bi_sql_editor: Replace deprecated datetime.utcnow() #1020

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
May 21, 2025

Conversation

emmanuel-ferdman
Copy link
Contributor

@emmanuel-ferdman emmanuel-ferdman commented May 12, 2025

[FIX] bi_sql_editor: Replace deprecated datetime.utcnow()

Replace deprecated datetime.utcnow() with timezone-aware equivalent
datetime.now(timezone.utc) to resolve Python 3.12+ deprecation warnings.

Affected files:

  • bi_sql_editor/models/bi_sql_view.py

@OCA-git-bot
Copy link
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@emmanuel-ferdman
Copy link
Contributor Author

@legalsylvain sorry for the mess on previous PR - GitHub didn't let me change the target branch. Should be good now 😄

@pedrobaeza pedrobaeza added this to the 18.0 milestone May 13, 2025
@pedrobaeza
Copy link
Member

@emmanuel-ferdman
Copy link
Contributor Author

@legalsylvain @legalsylvain - fixed PR to only contain datetime-related changes with one commit (squashed) targeting 18.0 branch. thanks for the review.

@pedrobaeza
Copy link
Member

The commit message is still incorrect.

@emmanuel-ferdman emmanuel-ferdman changed the title Migrate to modern Python datetime API [18.0][FIX] bi_sql_editor: Replace deprecated datetime.utcnow() May 13, 2025
@emmanuel-ferdman
Copy link
Contributor Author

@pedrobaeza is it ok now?

@pedrobaeza
Copy link
Member

I'm afraid not. The commit message remains the same:

imagen

Use timezone-aware datetime methods to resolve deprecation warnings.

Signed-off-by: Emmanuel Ferdman <[email protected]>
@emmanuel-ferdman
Copy link
Contributor Author

@pedrobaeza I see what you mean. fixed now. thanks

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1020-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 96c0eac. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit 391ae15 into OCA:18.0 May 21, 2025
7 checks passed
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.

4 participants