-
Notifications
You must be signed in to change notification settings - Fork 3
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
added retry_on_error to the conn object returned by the Is_sentinel f… #69
Conversation
WalkthroughThe changes in this pull request modify the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
falkordb/falkordb.py (1)
126-126
: LGTM! Consider adding a docstring update.The addition of the
retry_on_error
parameter to themaster_for
method call is a good improvement. It provides more granular control over error handling in sentinel connections, which aligns with the PR objective.Consider updating the class docstring to mention this new parameter and its purpose. This will help users understand the new functionality without having to dive into the implementation details.
Example docstring addition:
""" ... Args: ... retry_on_error (bool, optional): If True, retry on connection errors when using sentinel. Defaults to None. ... """
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
+ Coverage 92.26% 92.29% +0.03%
==========================================
Files 35 35
Lines 2610 2610
==========================================
+ Hits 2408 2409 +1
+ Misses 202 201 -1 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- falkordb/falkordb.py (1 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
falkordb/falkordb.py
[warning] 126-126: falkordb/falkordb.py#L126
Added line #L126 was not covered by tests
🔇 Additional comments (2)
falkordb/falkordb.py (2)
Line range hint
1-125
: LGTM: Addition ofretry_on_error
parameterThe addition of the
retry_on_error
parameter to the__init__
method signature enhances the flexibility of error handling in theFalkorDB
class. This change aligns well with the PR objectives.🧰 Tools
🪛 Ruff
124-124:
Is_Sentinel
may be undefined, or defined from star imports(F405)
125-125:
Sentinel_Conn
may be undefined, or defined from star imports(F405)
128-128:
Is_Cluster
may be undefined, or defined from star imports(F405)
129-129:
Cluster_Conn
may be undefined, or defined from star imports(F405)
🪛 GitHub Check: codecov/patch
[warning] 126-126: falkordb/falkordb.py#L126
Added line #L126 was not covered by tests
126-126
: Verify the impact of removingretry
parameterThe
retry
parameter has been removed from themaster_for
method call. Please confirm if this change intentionally modifies the retry behavior for sentinel connections. If so, ensure that the new behavior aligns with the expected functionality.✅ Verification successful
Follow-up:
Impact of Removing
retry
Parameter VerifiedNo other instances of
master_for
method calls with theretry
parameter were found in the codebase. The removal of theretry
parameter appears to be intentional and does not impact other parts of the system.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for other occurrences of master_for method calls with retry parameter # Test: Search for other master_for method calls with retry parameter rg --type python 'master_for.*retry'Length of output: 69
Script:
#!/bin/bash # Description: Check for other occurrences of master_for method calls with retry parameter # Test: Search for other master_for method calls with retry parameter using the correct file type rg --type py 'master_for.*retry'Length of output: 34
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 126-126: falkordb/falkordb.py#L126
Added line #L126 was not covered by tests
@@ -123,7 +123,7 @@ | |||
|
|||
if Is_Sentinel(conn): | |||
self.sentinel, self.service_name = Sentinel_Conn(conn, ssl) | |||
conn = self.sentinel.master_for(self.service_name, ssl=ssl, retry=retry) | |||
conn = self.sentinel.master_for(self.service_name, ssl=ssl) |
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.
Add test coverage for the modified line
The static analysis tool indicates that the modified line 126 is not covered by tests. Consider adding test cases to cover this change and ensure the new behavior works as expected.
Would you like assistance in generating test cases for this change?
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 126-126: falkordb/falkordb.py#L126
Added line #L126 was not covered by tests
…unction
Summary by CodeRabbit
New Features
Bug Fixes