Skip to content

Conversation

@sfc-gh-bchinn
Copy link
Contributor

@sfc-gh-bchinn sfc-gh-bchinn commented Sep 11, 2025

Port PR: https://github.com/snowflakedb/Stored-Proc-Python-Connector/pull/225

On main, the following code shows the following mypy errors:

from snowflake.connector import connect, DictCursor

def main() -> None:
    conn = connect()

    c1 = conn.cursor()
    print([row[0] for row in c1.fetchall()])

    c2: DictCursor = conn.cursor(DictCursor)
    print([row["COL1"] for row in c2.fetchall()])
  • error: Incompatible types in assignment (expression has type "SnowflakeCursor", variable has type "DictCursor") [assignment]
  • error: No overload variant of "__getitem__" of "tuple" matches argument type "str" [call-overload]

This change fixes both errors.

Copy link
Contributor Author

sfc-gh-bchinn commented Sep 11, 2025

@sfc-gh-bchinn sfc-gh-bchinn changed the title SNOW-2333702 Fix types of fetchone, fetchmany, fetchall SNOW-2333702 Fix types for DictCursor Sep 11, 2025
@sfc-gh-bchinn sfc-gh-bchinn marked this pull request as ready for review September 11, 2025 20:56
@sfc-gh-bchinn sfc-gh-bchinn requested a review from a team as a code owner September 11, 2025 20:56
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch 2 times, most recently from 325d395 to ec95863 Compare September 11, 2025 23:29
@sfc-gh-bchinn sfc-gh-bchinn changed the base branch from bchinn-dict-cursor-sfqid to graphite-base/2532 September 16, 2025 16:33
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch from ec95863 to 3e1805e Compare September 16, 2025 16:33
@graphite-app graphite-app bot changed the base branch from graphite-base/2532 to main September 16, 2025 16:33
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch from 3e1805e to 2d014a0 Compare September 16, 2025 16:33
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch from 2d014a0 to 42ed777 Compare September 23, 2025 17:43
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch from 42ed777 to ac6f96b Compare September 23, 2025 22:17
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch from ac6f96b to 6394dbb Compare September 23, 2025 22:33
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch from 6394dbb to 34d9d94 Compare September 23, 2025 22:41
@sfc-gh-bchinn sfc-gh-bchinn force-pushed the bchinn-SNOW-2333702-conn-cursor branch from 34d9d94 to 000d9bb Compare September 23, 2025 23:01
@sfc-gh-pczajka sfc-gh-pczajka enabled auto-merge (squash) September 29, 2025 11:21
@sfc-gh-pczajka sfc-gh-pczajka merged commit 35c03cc into main Sep 29, 2025
98 of 102 checks passed
@sfc-gh-pczajka sfc-gh-pczajka deleted the bchinn-SNOW-2333702-conn-cursor branch September 29, 2025 11:21
@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants