-
-
Notifications
You must be signed in to change notification settings - Fork 414
chore: review validateColumnsByRangeResponse #8560
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: review validateColumnsByRangeResponse #8560
Conversation
Summary of ChangesHello @wemeetagain, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on refining the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request does a great job of simplifying and optimizing the logic in validateColumnsByRangeResponse. Using a Map for seenColumns to deduplicate and look up columns is much cleaner and more performant than the previous array-based approach. The subsequent optimizations to use columnSidecarsMap.has(i) for checking missing indices is also a significant improvement.
However, I've found a logic issue in the new implementation for checking out-of-order column indices. The current check can incorrectly flag columns as out of order when transitioning between slots. I've left a specific comment with a suggested fix for this.
nazarhussain
left a comment
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.
Apart from that one point highlighted by Gemini #8560 (comment), LGTM.
|
/gemini review |
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.
Code Review
This pull request simplifies the validation logic in validateColumnsByRangeResponse, which is a great improvement for readability and maintainability. The use of a Map to check for duplicates is much cleaner than the previous approach.
I've found a critical issue in the new logic for checking out-of-order column indices that could lead to incorrect warnings. I've provided a detailed comment and a code suggestion to fix this. I also found a minor redundancy that can be cleaned up. Overall, this is a good refactoring, and with the suggested fixes, it will be much more robust.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## mkeil/fix-by-range-validation #8560 +/- ##
================================================================
Coverage ? 52.10%
================================================================
Files ? 852
Lines ? 65426
Branches ? 4796
================================================================
Hits ? 34090
Misses ? 31267
Partials ? 69 🚀 New features to boost your workflow:
|
|
/gemini review |
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.
Code Review
This pull request provides a great simplification and performance improvement to the validateColumnsByRangeResponse function. By leveraging a Map to track seen columns, the logic for handling duplicates and out-of-order items is now much cleaner and more efficient. The changes are well-implemented and significantly enhance code readability. I have one suggestion to re-introduce sorting for column sidecars to improve the robustness of the function, but overall this is an excellent refactoring.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
matthewkeil
left a comment
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.
Should be ok. Still should throw for all out of order conditions but might throw to many or not enough warnings. But it simplifies the logic a lot so seems like a good tradeoff. Removes some of the duplication in the checks. Nice and DRY. Will get this unit tested asap to make sure it catches all cases
| if (currentSlot !== slot) { | ||
| // a new slot has started, reset index | ||
| currentIndex = -1; | ||
| } else { | ||
| currentIndex = columnSidecar.index; |
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.
Pretty sure there is a bug in this logic. If the columns are delivered out of order then the indexing will be off because its not slot-wise aware. I think it will end up throwing a whole slew (or possible not enough) errors/warnings after the out of order is found. I guess though big picture we will not really care "how many out of order" there are and will just downscore on the first one so really only the first matters
6d0776e
into
mkeil/fix-by-range-validation
Motivation
Description