Skip to content
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

Update the create_pool function in the client.py file of the psycopg backend to eliminate the runtime warning of psycopg_pool #1697

Merged
merged 1 commit into from
Aug 17, 2024

Conversation

zxj17815
Copy link
Contributor

@zxj17815 zxj17815 commented Aug 14, 2024

Description

psycopg_pool updated and generated a RuntimeWarning.

RuntimeWarning: opening the async pool AsyncConnectionPool in the constructor is deprecated and will not be supported anymore in a future release. Please use `await pool.open()`, or use the pool as context manager using: `async with AsyncConnectionPool(...) as pool: `..."

This update is change "create_pool" function, call "await pool.open()" explicitly.

Motivation and Context

There is a warning when using it. After checking the official documentation, I found that the official update has a RuntimeWarning.

How Has This Been Tested?

Use pgsql and the driver uses the latest psycopg and psycopg_pool

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

psycopg_pool updated and generated a RuntimeWarning. 
"RuntimeWarning: opening the async pool AsyncConnectionPool in the constructor is deprecated and will not be supported anymore in a future release. Please use `await pool.open()`, or use the pool as context manager using: `async with AsyncConnectionPool(...) as pool: `..."
update "create_pool" function, call "await pool.open()" explicitly.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10384410457

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 89.092%

Totals Coverage Status
Change from base Build 10244831838: 0.002%
Covered Lines: 5962
Relevant Lines: 6577

💛 - Coveralls

@abondar abondar merged commit 1ca1cad into tortoise:develop Aug 17, 2024
7 checks passed
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.

3 participants