PEDS-1257 Add Difference class with diff#9
Open
sonali-shaw wants to merge 3 commits into
Open
Conversation
grugna
reviewed
Jun 11, 2026
sgchoe
reviewed
Jun 11, 2026
sgchoe
reviewed
Jun 11, 2026
sgchoe
requested changes
Jun 11, 2026
sgchoe
left a comment
Contributor
There was a problem hiding this comment.
Please see my line level comments regarding output of removed records and reconsidering how record changes are determined.
grugna
reviewed
Jun 26, 2026
| for records in new_nodes.values(): | ||
| diff_records.extend(records) | ||
| else: | ||
| if self._strip_timestamps(new_nodes) != self._strip_timestamps(old[sid]): |
Contributor
There was a problem hiding this comment.
you want to sort this before comparison, PFB doesn't guarantee ordering:
def normalize(records):
return sorted(
records,
key=lambda r: json.dumps(r, sort_keys=True)
)
grugna
reviewed
Jun 26, 2026
|
|
||
| print(f"Written to {output_path} with {len(diff_records)} records") | ||
|
|
||
| def create_test_diff_avro(self, output_path: str): |
Contributor
There was a problem hiding this comment.
unless there is a specific use for this the test one should be removed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Created the class Difference in pfb_to_zip.py that generates the difference between two datasets writes it out as an avro file. This functionality can be used from the command line with -d (diff.zip will be downloaded). Additionally, there will be another file downloaded containing some relevant console output (such as withdrawn consent indicating deleted subjects).