-
Notifications
You must be signed in to change notification settings - Fork 75
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
Refactors Redis Persister #471
Conversation
This adds a new class RedisBasePersister that the old one inherits from. The reason to do this is that if someone wants to test things, then being able to inject a mock redis client makes this simpler. So refactoring to enable that while still being backwards compatible. Appropriately marked things as deprecated and tests have been updated.
A preview of 428224d is uploaded and can be seen here: ✨ https://burr.dagworks.io/pull/471 ✨ Changes may take a few minutes to propagate. Since this is a preview of production, content with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to 0df8999 in 1 minute and 16 seconds
More details
- Looked at
176
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. burr/integrations/persisters/b_redis.py:31
- Draft comment:
Thefrom_values
method should not be a class method since it does not use thecls
parameter to create an instance. Consider removing the@classmethod
decorator. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. burr/integrations/persisters/b_redis.py:161
- Draft comment:
Using__del__
for closing connections is not reliable. Consider using a context manager to ensure the connection is closed properly. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_d6od0ep7AYj0OSCD
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 428224d in 14 seconds
More details
- Looked at
9
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. tests/integrations/persisters/test_b_redis.py:72
- Draft comment:
The import ofRedisPersister
is unnecessary as it is not used in the tests. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
The testtest_redis_persister_class_backwards_compatible
correctly tests the backward compatibility of the RedisPersister class. However, the import of RedisPersister is unnecessary in the context of the other tests, which only use RedisBasePersister. This import should be removed to clean up the code.
Workflow ID: wflow_nAKrmiFjVykMFLSI
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
This adds a new class RedisBasePersister that the old one inherits from.
The reason to do this is that if someone wants to test things, then being able to inject a mock redis client makes this simpler. So refactoring to enable that while still being backwards compatible.
Appropriately marked things as deprecated and tests have been updated.
Changes
How I tested this
Notes
Checklist
Important
Refactors Redis persister by introducing
RedisBasePersister
for easier testing, deprecatingRedisPersister
, and updating tests and documentation.RedisBasePersister
class inb_redis.py
for easier testing with mock Redis clients.RedisPersister
now inherits fromRedisBasePersister
and is marked as deprecated.RedisPersister
class remains functional for backward compatibility.persister.rst
to referenceRedisBasePersister
instead ofRedisPersister
.test_b_redis.py
to useRedisBasePersister
.RedisPersister
remains backward compatible.This description was created by for 428224d. It will automatically update as commits are pushed.