-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
chore(sqllab): Remove validation result from state #24082
chore(sqllab): Remove validation result from state #24082
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24082 +/- ##
==========================================
+ Coverage 68.30% 68.37% +0.06%
==========================================
Files 1957 1959 +2
Lines 75594 75606 +12
Branches 8224 8231 +7
==========================================
+ Hits 51637 51692 +55
+ Misses 21849 21801 -48
- Partials 2108 2113 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 24 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
4591b72
to
8961780
Compare
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.
Thank you for the changes @justinpark. I left some first-pass comments.
}, | ||
], | ||
}; | ||
const expectDbId = 'db1'; |
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.
Nice code organization!
}, | ||
{ overwriteRoutes: true }, | ||
); | ||
const { result, waitFor } = renderHook( |
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.
This piece of code is identical to previous tests. Can you extract a function called initialize
that accepts an optional withValidator
? Something like:
const initialize = (withValidator?: boolean) => {...};
// First test
const { result } = initialize()
// Second and third tests
const { result } = initialize(true)
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.
Done!
8961780
to
0048a83
Compare
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.
LGTM
SUMMARY
Similar to #23488 and #23257, this commit migrates the queryValidations state from redux to rdk-query to reduce the complexity of the queryEditor state.
This commit not only reduces the state structure but also reuses the pre-validate result.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
after--validation-state-refactor.mov
Before:
before--validation-state-refactor.mov
TESTING INSTRUCTIONS
Go to sqllab and type invalid sql in the editor
check the validation errors
ADDITIONAL INFORMATION