Skip to content

Declare fetchmany and fetchall to return lists instead of Sequence #71

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

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

Saharsh-R
Copy link

@Saharsh-R Saharsh-R commented Aug 3, 2024

Signed-off-by: Saharsh Rathi [email protected]

Closes #70

Describe your changes
I have changed the typing of return type of fetchall and fetchmany from collections.abc.Sequence -> typing.List

Testing performed
No tests written.

Additional context
Add any other context about your contribution here.

Previously their annotations used the less specific `Sequence` type,
despite the docstring saying that lists are returned. This caused type
checkers to reject concatenating two result sets with `+`.

Signed-off-by: Saharsh Rathi <[email protected]>
Copy link
Contributor

@godlygeek godlygeek left a comment

Choose a reason for hiding this comment

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

I rewrote your commit message to add details about the motivation for this change, but otherwise this LGTM. Thanks @Saharsh-R!

@godlygeek godlygeek enabled auto-merge (rebase) August 5, 2024 23:24
@godlygeek godlygeek changed the title change return type of fetchmany and fetchall from Sequence to List Declare fetchmany and fetchall to return lists instead of Sequence Aug 5, 2024
@godlygeek godlygeek self-assigned this Aug 5, 2024
@godlygeek godlygeek merged commit aae3395 into bloomberg:main Aug 5, 2024
11 checks passed
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.

Mismatch between documentation and returned type
2 participants