Skip to content

Skip module check if server doesn't support MODULE LIST #16

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
Sep 22, 2021

Conversation

jeffreylovitz
Copy link
Contributor

No description provided.

module_graph[3] if module_graph
module_version = module_graph[3] if module_graph
raise ServerError, "RedisGraph module not loaded." if module_version.nil?
raise ServerError, "RedisGraph module incompatible, expecting >= 1.99." if module_version < 19900
Copy link

Choose a reason for hiding this comment

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

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [101/80]
Style/NumericLiterals: Use underscores(_) as decimal mark and separate every 3 digits with them.

module_graph = modules.detect { |_name_key, name, _ver_key, _ver| name == 'graph' }
module_graph[3] if module_graph
module_version = module_graph[3] if module_graph
raise ServerError, "RedisGraph module not loaded." if module_version.nil?
Copy link

Choose a reason for hiding this comment

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

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

begin
modules = @connection.call("MODULE", "LIST")
rescue Redis::CommandError
# Ignore check if the connected server does not support the "MODULE LIST" command
Copy link

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [87/80]

modules = @connection.call("MODULE", "LIST")

begin
modules = @connection.call("MODULE", "LIST")
Copy link

Choose a reason for hiding this comment

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

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

end

# Ensure that the connected Redis server supports modules
# and has loaded the RedisGraph module
def module_version()
def check_module_version()
Copy link

Choose a reason for hiding this comment

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

Metrics/AbcSize: Assignment Branch Condition size for check_module_version is too high. [16.58/15]
Metrics/MethodLength: Method has too many lines. [12/10]
Style/DefWithParentheses: Omit the parentheses in defs when the method doesn't accept any arguments.

@@ -89,7 +89,7 @@ def create_graph()
it "should print property strings correctly after updates" do
q = """MATCH (a {name: 'src1'}) RETURN a"""
res = @r.query(q)
expect(res.resultset).to eq([[[{"name"=>"src1"}, {"color"=>"cyan"}, {"newval"=>TRUE}]]])
expect(res.resultset).to eq([[[{"name"=>"src1"}, {"color"=>"cyan"}, {"newval"=>true}]]])
Copy link

Choose a reason for hiding this comment

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

Layout/SpaceInsideHashLiteralBraces: Space inside { missing.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Layout/SpaceAroundOperators: Surrounding space missing for operator =>.
Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
Metrics/LineLength: Line is too long. [94/80]

@jeffreylovitz jeffreylovitz force-pushed the optional-module-detection branch from 757784d to 04a1f87 Compare September 22, 2021 16:53
@jeffreylovitz jeffreylovitz merged commit 9ffba1d into master Sep 22, 2021
@jeffreylovitz jeffreylovitz deleted the optional-module-detection branch September 22, 2021 16:54
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.

1 participant