-
I write code same as documentation, but VS Code Pylance raise a problem: "connect" is not exported from module "oracledb" the code is: import oracledb
conn = oracledb.connect(...) # error is here
cursor = conn.cursor() # the type of `cursor` variable is `Cursor`, that's right So I change the code to: from oracledb.connection import connect as oracle_connect
conn = oracle_connect(...) # that is ok
cursor = conn.cursor() # but the type of `cursor` variable is `Any` in mypy Now, I must write more code: from oracledb.connection import connect as oracle_connect
from oracledb.cursor import Cursor
conn = oracle_connect(...) # that is ok
cursor = conn.cursor() # the type of `cursor` variable is `Cursor`, that's right I use Python 3.10.9, and the oracledb's version is 1.2.2. |
Beta Was this translation helpful? Give feedback.
Answered by
cjbj
Apr 15, 2023
Replies: 1 comment 1 reply
-
Update to python-oracledb 1.3. There were some improvements in this release precisely to help in IDEs: "Improved type annotations." |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
cjbj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update to python-oracledb 1.3. There were some improvements in this release precisely to help in IDEs: "Improved type annotations."