Skip to content

refactor ast validations #2730

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 39 commits into from
Dec 21, 2022
Merged

refactor ast validations #2730

merged 39 commits into from
Dec 21, 2022

Conversation

AviAvni
Copy link
Contributor

@AviAvni AviAvni commented Nov 22, 2022

@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Base: 92.26% // Head: 92.12% // Decreases project coverage by -0.13% ⚠️

Coverage data is based on head (f737f3b) compared to base (3268829).
Patch coverage: 88.57% of modified lines in pull request are covered.

❗ Current head f737f3b differs from pull request most recent head c064ccf. Consider uploading reports for the commit c064ccf to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2730      +/-   ##
==========================================
- Coverage   92.26%   92.12%   -0.14%     
==========================================
  Files         264      264              
  Lines       25259    25091     -168     
==========================================
- Hits        23306    23116     -190     
- Misses       1953     1975      +22     
Impacted Files Coverage Δ
src/ast/ast_validations.c 94.09% <ø> (-2.47%) ⬇️
src/ast/ast_visitor.c 78.26% <78.26%> (ø)
src/ast/ast.c 93.16% <93.18%> (-0.77%) ⬇️
src/ast/ast_rewrite_star_projections.c 98.78% <100.00%> (-1.22%) ⬇️
src/module.c 70.58% <100.00%> (ø)
src/procedures/proc_sp_paths.c 95.12% <0.00%> (-0.86%) ⬇️
src/arithmetic/arithmetic_expression_construct.c 93.68% <0.00%> (-0.41%) ⬇️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@raz-mon raz-mon requested a review from swilly22 December 12, 2022 13:12
@@ -84,7 +84,7 @@ def test_missing_sections_reduction(self):
try:
self.graph.query(q).result_set
except ResponseError as e:
self.env.assertIn("n not defined", str(e))
self.env.assertIn("Unknown function 'reduce'", str(e))
Copy link
Contributor

Choose a reason for hiding this comment

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

Unknown function 'reduce' seems like a misleading error message, as the function reduce does exists...

Copy link
Collaborator

@raz-mon raz-mon Dec 18, 2022

Choose a reason for hiding this comment

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

The parser doesn't recognize the reduce pattern, so it is parsed as a function call and thus the error-message.
I think this can be a good sign to the user that he did something wrong, since as you said, reduce is not a function.

I can add a check for this if you disagree.

(
void *ctx, // context to attach to the new visitor
ast_visitor_mapping mapping // mapping between ast-node-types to visiting functions
ast_visitor *visitor // visitor
Copy link
Contributor

Choose a reason for hiding this comment

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

const

(
void *ctx, // context to attach to the new visitor
ast_visitor_mapping mapping // mapping between ast-node-types to visiting functions
ast_visitor *visitor // visitor
Copy link
Contributor

Choose a reason for hiding this comment

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

const

// creates a new visitor
ast_visitor *AST_Visitor_new
// get the context of a visitor
void *AST_VisitorGetContext
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to: AST_Visitor_GetContext

@swilly22 swilly22 merged commit 044082f into master Dec 21, 2022
@swilly22 swilly22 deleted the refactor-ast-validations branch December 21, 2022 11:11
@AviAvni AviAvni mentioned this pull request Feb 14, 2023
pnxguide pushed a commit to CMU-SPEED/RedisGraph that referenced this pull request Mar 22, 2023
* wip refactor ast validations

* WIP Introduced validations for reduce and union

* Reduce validation fix

* forget prior env in WITH clause

* fixed CALL validations

* fix index validations

* fix rel-pattern validation

* reformating and comment-fixing

* fix tck tests

* leak fix

* fix leak 2

* leak fix & union type support

* leak fix

* fix and formatting

* fix list comprehension, pattern comprehension

* added test for redeclaration in merge

* short circuit validation

* Added fast-error-folding

* Revert 'short circuit validation' and 'Added fast-error-folding' commits

* design change

* promote CALL validations

* fix

* leak fix

* unified mapping initialization, unified cypher-whitelist check

* review changes

* Addressing review comments

* fix

* Addressing comments

* small fix

* fix

* fix2

Co-authored-by: razmon <razmonsonego2@gmail.com>
Co-authored-by: Raz Monsonego <74051729+raz-mon@users.noreply.github.com>
Co-authored-by: swilly22 <roi@redislabs.com>
Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>
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.

3 participants