ConnectionPool.acquire instance method returns type checking errors · Issue #52 · oracle/python-oracledb (original) (raw)

1. What versions are you using?

Oracle 19c

platform.platform: macOS-11.6.8-x86_64-i386-64bit
sys.maxsize > 2**32: True
platform.python_version: 3.10.6

oracledb.__version__: 1.0.3

2. Is it an error or a hang or a crash?

None; it is a type checking error

3. What error(s) or behavior you are seeing?

When calling the instance method ConnectionPool.acquire using the with statement, type checking tools report errors:

4. Does your application call init_oracle_client()?

N/A

5. Include a runnable Python script that shows the problem.

from oracledb import pool

dbpool: pool.ConnectionPool = pool.create_pool( user="username", password="password", dsn="dsn" )

with dbpool.acquire() as conn: # type checking error shows here conn.ping() # works as expected, but conn is Unknown in type checkers