Conversation
Summary of ChangesHello, 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 significantly enhances the data sampling utility by introducing more flexible and powerful control mechanisms. It allows for comprehensive data capture through an exhaustive mode, ensures the inclusion of specific critical values, and provides finer control over the number of unique values sampled per column. These additions aim to make the data sampler more robust and adaptable to diverse data processing requirements, particularly for scenarios where complete or targeted data representation is crucial. Highlights
Changelog
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.
Code Review
This pull request introduces significant enhancements to the data sampler, adding an 'exhaustive' mode to capture all unique values and a mechanism to enforce the inclusion of specific values. The changes are well-implemented and include comprehensive tests for the new functionality. I've provided a couple of suggestions to improve code clarity and remove duplicated logic.
| 'The maximum number of unique values to track per column. ' | ||
| 'If 0 or -1, all unique values are tracked.') | ||
| flags.DEFINE_boolean( | ||
| 'sampler_exhaustive', False, |
There was a problem hiding this comment.
Seems we can have a combined flag to track both..do we necessarily need two separate flags for this?
| flags.DEFINE_string( | ||
| 'sampler_unique_columns', '', | ||
| 'A comma-separated list of column names to use for selecting unique rows.') | ||
| flags.DEFINE_list( |
There was a problem hiding this comment.
Can you also update the comment to describe the default behavior (empty)?
| # Process and write header rows from the first input file. | ||
| if row_index <= header_rows and input_index == 0: | ||
| self._process_header_row(row) | ||
| self._add_row_counts(row) |
There was a problem hiding this comment.
Curious where is this defined?
| # Check random sampler. | ||
| if sample_rate < 0: | ||
| sample_rate = self._config.get('sampler_rate') | ||
| sample_rate = self._config.get('sampler_rate', -1) |
There was a problem hiding this comment.
If sample_rate is negative, we are setting it default to negative again. Isn't that contradictory?
| return output_file | ||
|
|
||
|
|
||
| def load_column_keys(column_keys: list) -> dict: |
There was a problem hiding this comment.
Do we need to strip namespace here like it's done in _is_must_include?
Adds the following new features for data sampler:
This is used to create golden outputs with selected statvars such as NL index.