Skip to content

print plan only if no errors#1950

Merged
swilly22 merged 9 commits intomasterfrom
explain-emit-error
Sep 29, 2021
Merged

print plan only if no errors#1950
swilly22 merged 9 commits intomasterfrom
explain-emit-error

Conversation

@AviAvni
Copy link
Copy Markdown
Contributor

@AviAvni AviAvni commented Sep 19, 2021

No description provided.

void ExecutionPlan_Print(const ExecutionPlan *plan, RedisModuleCtx *ctx) {
ASSERT(plan && ctx);

if(ErrorCtx_EncounteredError()) return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove.

In cmd_explain.c

ExecutionPlan_PreparePlan(plan);
ExecutionPlan_Init(plan);       // Initialize the plan's ops.
if(ErrorCtx_EncounteredError()) {
    ErrorCtx_EmitException();
    goto cleanup;
}

ExecutionPlan_Print(plan, ctx); // Print the execution plan.
cleanup:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

why?
every time calling to ExecutionPlan_Print it is needed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is mixing boundaries, it is preferred that the execution-plan won't be aware of ErrorCtx,
also it seems weird that a call made to ExecutionPlan_PreparePlan won't print anything...

swilly22
swilly22 previously approved these changes Sep 20, 2021
Copy link
Copy Markdown
Contributor

@swilly22 swilly22 left a comment

Choose a reason for hiding this comment

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

Looking great!

@swilly22
Copy link
Copy Markdown
Contributor

@AviAvni tests fail due to redis-py usage of hiredis parser,
https://github.com/andymccurdy/redis-py#parsers
see if for failing test we can initialize redis-py without hiredis. (Unhandled exception: can't pickle hiredis.Reader objects)

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 29, 2021

Codecov Report

Merging #1950 (b960f66) into master (019bda3) will increase coverage by 0.74%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1950      +/-   ##
==========================================
+ Coverage   91.90%   92.65%   +0.74%     
==========================================
  Files         239      239              
  Lines       20372    20373       +1     
==========================================
+ Hits        18723    18876     +153     
+ Misses       1649     1497     -152     
Impacted Files Coverage Δ
src/commands/cmd_explain.c 84.21% <100.00%> (+0.42%) ⬆️
src/commands/cmd_query.c 96.62% <100.00%> (ø)
src/filter_tree/filter_tree.c 80.32% <0.00%> (+0.20%) ⬆️
src/arithmetic/arithmetic_expression_construct.c 91.93% <0.00%> (+0.48%) ⬆️
src/datatypes/map.c 100.00% <0.00%> (+1.48%) ⬆️
src/ast/ast_validations.c 95.01% <0.00%> (+1.55%) ⬆️
src/ast/ast_shared.c 99.15% <0.00%> (+1.69%) ⬆️
src/algorithms/all_neighbors.c 100.00% <0.00%> (+2.77%) ⬆️
src/ast/ast_build_filter_tree.c 96.53% <0.00%> (+2.97%) ⬆️
src/value.c 90.63% <0.00%> (+3.67%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 019bda3...b960f66. Read the comment docs.

@swilly22 swilly22 merged commit 69973de into master Sep 29, 2021
@swilly22 swilly22 deleted the explain-emit-error branch September 29, 2021 09:17
pnxguide pushed a commit to CMU-SPEED/RedisGraph that referenced this pull request Mar 22, 2023
* print plan only if no errors

* address review and fix tests

* update redisgraph version

* return error on profile

* add tests

* add comment

* Update cmd_query.c

Co-authored-by: Roi Lipman <[email protected]>
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