Skip to content

Conversation

DvirDukhan
Copy link

No description provided.

@DvirDukhan DvirDukhan requested a review from swilly22 June 9, 2020 15:35
test.py Outdated
Comment on lines 190 to 198
def test_cached_execution(self):
redis_graph = Graph('cached', self.r)
redis_graph.query("CREATE ()")
uncached_result = redis_graph.query("MATCH (n) RETURN n")
cached_result = redis_graph.query("MATCH (n) RETURN n")
self.assertEqual(uncached_result.result_set, cached_result.result_set)
self.assertFalse(uncached_result.cached_execution)
self.assertTrue(cached_result.cached_execution)

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't merge this until execution-plan cache is merged.

Comment on lines 228 to 236
return float(stat.split(': ')[1].split(' ')[0])
if(prop == "Cached execution"):
value = stat.split(': ')[1].split(' ')[0]
if value == "true":
return True
elif value == "false":
return False
else:
return float(stat.split(': ')[1].split(' ')[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't "Cached execution" be 0 or 1.
this would save this clunky parsing.

@@ -274,7 +268,7 @@ def indices_deleted(self):

@property
def cached_execution(self):
return self._get_stat(self.CACHED_EXECUTION)
return True if self._get_stat(self.CACHED_EXECUTION) == 1 else False
Copy link
Contributor

Choose a reason for hiding this comment

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

return self._get_stat(self.CACHED_EXECUTION) == 1

@swilly22 swilly22 merged commit d2cac0a into master Jun 18, 2020
@swilly22 swilly22 deleted the cached_execution branch June 18, 2020 20:05
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.

2 participants