-
Notifications
You must be signed in to change notification settings - Fork 513
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
Improve accuracy of FixQuery rule #5438
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5438 +/- ##
=======================================
Coverage 61.11% 61.11%
=======================================
Files 311 311
Lines 11075 11075
Branches 764 764
=======================================
+ Hits 6768 6769 +1
+ Misses 4307 4306 -1 ☔ View full report in Codecov by Sentry. |
Patch.replaceTree(t, q"$qual.queryRaw".syntax) | ||
case t @ q"$qual.query" if isQuery(t) => | ||
Patch.replaceTree(t, q"$qual.queryRaw".syntax) | ||
case t @ q"$qual.query.format" if isQueryFormat(qual) => | ||
Patch.replaceTree(t, q"$qual.queryRaw.format".syntax) |
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.
Shouldn't we try to directly use query(..)
in that case ?
Patch.replaceTree(t, q"$qual.queryRaw.format".syntax) | |
Patch.replaceTree(t, q"$qual.query".syntax) |
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.
I simplified it to single case
matching query
directly 👍
The accuracy of FixQuery was not good when used on
@BigQueryType.from
macros. By matching on the<macro>.query.from
expression, we can pick up on the macro class's ClassSignature, which includesHasQuery
as a parent.