SNOW-1763594: Correctly type CursorDict and add TupleDict
What is the current behavior?
cursor.fetchone(), cursor.fetchmany() and cursor.fetchall() return a union type between tuple and dict. That require a lot of casting to work with type checkers.
What is the desired behavior?
Return a dict(or list of dicts) if cursor is DictCursor, a tuple(or list of tuples) if cursor is a TupleCursor, and keep the current implementation to SnowflakeCursor.
How would this improve snowflake-connector-python?
It will improve the type hints
References and other background
This issue was mentioned on: https://github.com/snowflakedb/snowflake-connector-python/issues/1263 but closed after 6 months There was a Pull request with some implemntation, with some comments. https://github.com/snowflakedb/snowflake-connector-python/pull/1264
Hello @Polandia94 ,
Thanks for raising the issue, will check with team about the current status of the PR and update.
Regards, Sujan
Hello @Polandia94 ,
We will work on the fix, at present there is no ETA when it will be fixed or delivered.
Regards. Sujan