Skip to content

dbapi2.Cursor.description property type annotation should be Optional[...] #89

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

Open
jsurany opened this issue Apr 1, 2025 · 0 comments

Comments

@jsurany
Copy link

jsurany commented Apr 1, 2025

The dbapi2.Cursor._description can be null, so the accessor should be an Optional type.

>>> from comdb2 import dbapi2
>>> conn = dbapi2.connect("....")
>>> cursor = conn.cursor()
>>> type(cursor.description)
<class 'NoneType'>

The type annotation for the property is tuple[tuple[str, object, None, None, None, None, None], ...]

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

No branches or pull requests

1 participant