SNOW-874658: Type hints for execute and executemany in DictCursor is incorrect
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
Python version
Python 3.9.17
Operating system and processor architecture
macOS-13.4.1-arm64-arm-64bit
Installed packages
asn1crypto==1.5.1
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
cryptography==40.0.2
filelock==3.12.0
idna==3.4
oscrypto==1.3.0
packaging==23.1
pycparser==2.21
pycryptodomex==3.18.0
PyJWT==2.7.0
pyOpenSSL==23.1.1
pytz==2023.3
requests==2.31.0
snowflake-connector-python==3.0.4
sortedcontainers==2.4.0
typing_extensions==4.6.0
urllib3==1.26.16
What did you do?
# Write some code using execute or executemany and run mypy
#
# Like
connection = snowflake.connector.connect(...)
with connection.cursor(DictCursor) as cur: # issue here too, as cursor always returns a SnowflakeCursor, this should be generified
cur.execute("SELECT c1,c2 FROM example")
results = cur.fetchall()
for row in results:
c1 = row["C1"] # error here, as SnowflakeCursor marks return type as list
# The issue stems from DictCursor not defining overrides correctly.
What did you expect to see?
No mypy errors
Can you set logging to DEBUG and collect the logs?
No response
- Dominant language
- Python
- Stars
- 730
- Forks
- 574
- Avg merge
- 5h 45m
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from snowflakedb/snowflake-connector-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug status-triage_done
snowflakedb/snowflake-connector-python#3034 · 1 comment · 1 assignee ·
-
status-triage_done
Difficulty 5/5 Over a week Newbie friendliness 25/100
snowflakedb/snowflake-connector-python#3026 · 1 comment ·
-
bug status-triage_done
snowflakedb/snowflake-connector-python#3019 · 2 comments · 1 assignee ·
-
bug status-triage_done
snowflakedb/snowflake-connector-python#3011 · 2 comments · 1 assignee ·
All issues in snowflakedb/snowflake-connector-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·