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

add tupleCursor and type dictCursor #2086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Polandia94
Copy link

@Polandia94 Polandia94 commented Oct 25, 2024

Add tupleCursor like dictCursor but always return Tuple. Modify types of dictCursor to always return dict
related to: #2085

Copy link

github-actions bot commented Oct 25, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Polandia94 Polandia94 force-pushed the SNOW-1763594-add-TupleCursor-and-type-DictCursor branch from 71c57e4 to 7f9d76b Compare October 25, 2024 15:13
@Polandia94
Copy link
Author

recheck

@Polandia94
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

def fetchall(self) -> list[dict]:
return super().fetchall()

class TupleCursor(SnowflakeCursor):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need TupleCursor? this is effectively the default SnowflakeCursor.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SnowflakeCursor has to return Union[None|dict|tuple] because could be instanciated as
SnowflakeCursor(use_dict_result=True).

TupleCursor is just a SnowflakeCursor that return Union[None|tuple] on fetch

On DictCursor the better types will not require nothing for the user, on TupleCursor it will require that they start to instanciate as TupleDict, so maybe its not useful. I let you to decide, let me know if you want and i delete the TupleCursor from PR and issue.

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

Successfully merging this pull request may close these issues.

2 participants