-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pins deepdiff to the latest version (8) which includes a fix a PyYAML dependency issue with Cython [1]. Also, replaces the deep diff CLI command in a functional test with a custom Python script that uses the DeepDiff class, working around an issue where the deep diff CLI did not properly recognize numeric values and caused the functional test to fail spuriously. This commit should fix CI for Python versions 3.10 and 3.11. [1] seperman/deepdiff#406
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""Compare TSV files line by line with deepdiff | ||
""" | ||
import argparse | ||
import deepdiff | ||
import pandas as pd | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser( | ||
description="Compare TSV files line by line with deepdiff", | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter | ||
) | ||
parser.add_argument("first_tsv", help="first TSV to compare") | ||
parser.add_argument("second_tsv", help="second TSV to compare") | ||
parser.add_argument("--significant-digits", type=int, default=6, help="number of significant digits to use when comparing numeric values") | ||
|
||
args = parser.parse_args() | ||
|
||
first_tsv = pd.read_csv( | ||
args.first_tsv, | ||
sep="\t", | ||
header=None, | ||
na_filter=False, | ||
).to_dict() | ||
|
||
second_tsv = pd.read_csv( | ||
args.second_tsv, | ||
sep="\t", | ||
header=None, | ||
na_filter=False, | ||
).to_dict() | ||
|
||
print( | ||
deepdiff.DeepDiff( | ||
first_tsv, | ||
second_tsv, | ||
significant_digits=args.significant_digits, | ||
) | ||
) |
This file contains 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