This repository was archived by the owner on May 17, 2024. It is now read-only.
Repository navigation
cli: output diff as jsonl, stats as json #90
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
cli: add --json for stats, table1 + table2 counts
- Loading branch information
commit 94d1419091ee4c6266a4ea66713ff8ee280d9376
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -384,8 +384,9 @@ def _bisect_and_diff_tables(self, table1, table2, level=0, max_rows=None): | |
|
|
||
| # This happens when the initial bisection threshold is larger than | ||
| # the table itself. | ||
| if level == 0 and not self.stats.get("table_count", False): | ||
| self.stats["table_count"] = self.stats.get("table_count", 0) + max(len(rows1), len(rows2)) | ||
| if level == 0 and not self.stats.get("table1_count", False): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. But I think we always want to override these attribute. Why would we care what previous values they held?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (talked about on slack, just for the record) Will double count if it's not level 0, but we can remove the not |
||
| self.stats["table1_count"] = self.stats.get("table1_count", 0) + len(rows1) | ||
| self.stats["table2_count"] = self.stats.get("table2_count", 0) + len(rows2) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still this line... just No? |
||
|
|
||
| logger.info(". " * level + f"Diff found {len(diff)} different rows.") | ||
| self.stats["rows_downloaded"] = self.stats.get("rows_downloaded", 0) + max(len(rows1), len(rows2)) | ||
|
|
@@ -426,7 +427,8 @@ def _diff_tables(self, table1, table2, level=0, segment_index=None, segment_coun | |
| return | ||
|
|
||
| if level == 1: | ||
| self.stats["table_count"] = self.stats.get("table_count", 0) + max(count1, count2) | ||
| self.stats["table1_count"] = self.stats.get("table_count1", 0) + count1 | ||
| self.stats["table2_count"] = self.stats.get("table_count2", 0) + count2 | ||
|
|
||
| if checksum1 != checksum2: | ||
| yield from self._bisect_and_diff_tables(table1, table2, level=level, max_rows=max(count1, count2)) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
BTW I stopped rounding aggressively here because e.g. when I have 1 different row for 100m entries, it just shows 0 with that previous rounding