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

refactor: updating typing for xreadgroup / xread / xadd #130

Merged

Conversation

imnotjames
Copy link
Contributor

@imnotjames imnotjames commented Dec 2, 2024

Pull Request check-list

  • Do tests and lints pass with this change?
  • 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)?

Description of change

the typing for these functions are invariant and cannot be used with a typed dict as easily because of that

fixes #129

@imnotjames imnotjames force-pushed the refactor/xadd-xread-xreadgroup-dict-typing branch 2 times, most recently from 5f0bf34 to 6bc8e03 Compare December 2, 2024 07:50
@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.20%. Comparing base (e74cefa) to head (eb14418).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #130      +/-   ##
==========================================
- Coverage   76.20%   76.20%   -0.01%     
==========================================
  Files         130      130              
  Lines       33909    33911       +2     
==========================================
  Hits        25842    25842              
- Misses       8067     8069       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@imnotjames
Copy link
Contributor Author

imnotjames commented Dec 7, 2024

After running this a bit while developing interactions with valkey streams I think the types here seem to work and prevent incorrect types getting in.

I've been testing with pyright, tho - not mypy. Not sure how to validate with mypy.

@imnotjames imnotjames marked this pull request as ready for review December 7, 2024 06:59
@imnotjames
Copy link
Contributor Author

imnotjames commented Dec 7, 2024

Ah wait, perhaps I shouldn't have merged - that won't have the sign off 🤦

Let me know if you'd prefer a rebase.

EDIT: Yeah I'll just rebase so I get the build to run in my local repo

@imnotjames imnotjames force-pushed the refactor/xadd-xread-xreadgroup-dict-typing branch 2 times, most recently from 2e2aa6c to 278b57f Compare December 7, 2024 19:47
the typing for these functions are invariant and cannot
be used with a typed dict as easily because of that

Signed-off-by: James Ward <[email protected]>
@imnotjames imnotjames force-pushed the refactor/xadd-xread-xreadgroup-dict-typing branch from 278b57f to eb14418 Compare December 7, 2024 19:49
@mkmkme
Copy link
Collaborator

mkmkme commented Dec 9, 2024

The changes look good to me. @Rafiot could you take a look and tell if the changes look good to you as well?

@Rafiot
Copy link

Rafiot commented Dec 9, 2024

Yep, looks fine to me too.

Copy link
Collaborator

@mkmkme mkmkme left a comment

Choose a reason for hiding this comment

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

Thanks!

@mkmkme mkmkme merged commit 1f6b63c into valkey-io:main Dec 9, 2024
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xadd & xread & xreadgroup use invariant dict typing
5 participants