Skip to content
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

SNOW-1763594: Correctly type CursorDict and add TupleDict #2085

Open
Polandia94 opened this issue Oct 25, 2024 · 2 comments
Open

SNOW-1763594: Correctly type CursorDict and add TupleDict #2085

Polandia94 opened this issue Oct 25, 2024 · 2 comments
Assignees
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team

Comments

@Polandia94
Copy link

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:
#1263
but closed after 6 months
There was a Pull request with some implemntation, with some comments.
#1264

@github-actions github-actions bot changed the title Correctly type CursorDict and add TupleDict SNOW-1763594: Correctly type CursorDict and add TupleDict Oct 25, 2024
@sfc-gh-sghosh sfc-gh-sghosh self-assigned this Oct 28, 2024
@sfc-gh-sghosh sfc-gh-sghosh added status-triage Issue is under initial triage and removed needs triage labels Oct 28, 2024
@sfc-gh-sghosh
Copy link

Hello @Polandia94 ,

Thanks for raising the issue, will check with team about the current status of the PR and update.

Regards,
Sujan

@sfc-gh-sghosh
Copy link

Hello @Polandia94 ,

We will work on the fix, at present there is no ETA when it will be fixed or delivered.

Regards.
Sujan

@sfc-gh-sghosh sfc-gh-sghosh added status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

3 participants