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

[types] update return type of smismember to list[int] #2617

Merged
merged 2 commits into from
Mar 15, 2023

Conversation

ryin1
Copy link
Contributor

@ryin1 ryin1 commented Mar 14, 2023

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

smismember returns a list of ints (0 or 1), not a list of bools:
image

  • It seems sismember returns bool though, so didn't change that.
In [10]: redis_client.smismember('key', '1')
Out[10]: [0]

In [11]: redis_client.sismember('key', '1')
Out[11]: False

are there plans to make smismember return a list[bool] instead? if so I can just close this. thanks!

@@ -3357,10 +3357,12 @@ def smembers(self, name: str) -> Union[Awaitable[Set], Set]:

def smismember(
self, name: str, values: List, *args: List
) -> Union[Awaitable[List[bool]], List[bool]]:
) -> Union[Awaitable[List[int]], List[int]]:

Choose a reason for hiding this comment

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

Minor note: Union[Awaitable[List[Union[Literal[0], Literal[1]]]], List[Union[Literal[0], Literal[1]]]].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great suggestion, thanks! updated

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.06 ⚠️

Comparison is base (6c708c2) 92.31% compared to head (0060d95) 92.26%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2617      +/-   ##
==========================================
- Coverage   92.31%   92.26%   -0.06%     
==========================================
  Files         115      115              
  Lines       29744    29744              
==========================================
- Hits        27459    27443      -16     
- Misses       2285     2301      +16     
Impacted Files Coverage Δ
redis/commands/core.py 82.15% <ø> (ø)

... and 7 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ryin1
Copy link
Contributor Author

ryin1 commented Mar 15, 2023

=========================== short test summary info ============================
FAILED tests/test_graph.py::test_query_timeout - Failed: DID NOT RAISE <class...
= 1 failed, 3320 passed, 94 skipped, 816 deselected, 1 xfailed, 3 warnings in 145.60s (0:02:25) =

This seems like an unrelated test failure

@dvora-h dvora-h added the maintenance Maintenance (CI, Releases, etc) label Mar 15, 2023
@dvora-h dvora-h merged commit a372ba4 into redis:master Mar 15, 2023
aksinha334 pushed a commit to aksinha334/redis-py that referenced this pull request Mar 15, 2023
* update return type of smismember

* use Literal instead of int
@ryin1 ryin1 deleted the ryin--update-smismember-args branch March 15, 2023 19:21
dvora-h added a commit that referenced this pull request Mar 15, 2023
* Fixed issue #2598 - make Document class subscriptable

* Last time added older file, fixed it

* retrigger checks

* update json().arrindex() default values (#2611)

* update json().arrindex() default values

* add unit test

* fix falsy checks

* more unit tests

* add asyncio tests

* fix lint line length

---------

Co-authored-by: Alex Schmitz <aschmitz@box.com>

* Speeding up the protocol parsing (#2596)

* speeding up the protocol parser

* linting

* changes to ease

* Fixed CredentialsProvider examples (#2587)

Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>

* ConnectionPool SSL example (#2605)

* [types] update return type of smismember to list[int] (#2617)

* update return type of smismember

* use Literal instead of int

* retrigger checks

* Added test for document subscriptable in tests/test_search.py

* Fixed linter issue

* retrigger checks

---------

Co-authored-by: Alex Schmitz <alex.schmitz@gmail.com>
Co-authored-by: Alex Schmitz <aschmitz@box.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
Co-authored-by: Bar Shaul <88437685+barshaul@users.noreply.github.com>
Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
Co-authored-by: CrimsonGlory <CrimsonGlory@users.noreply.github.com>
Co-authored-by: Raymond Yin <raymond@tryevergreen.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance (CI, Releases, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants