-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Checks if two parquet files are equal | ||
""" | ||
import sys | ||
import pandas as pd | ||
|
||
def compare_parquet_files(file1, file2): | ||
df1 = pd.read_parquet(file1) | ||
df2 = pd.read_parquet(file2) | ||
|
||
if df1.shape != df2.shape: | ||
return False | ||
|
||
if set(df1.columns) != set(df2.columns): | ||
return False | ||
|
||
return df1.equals(df2) | ||
|
||
# Example usage | ||
file1 = sys.argv[1] | ||
file2 = sys.argv[2] | ||
|
||
if compare_parquet_files(file1, file2): | ||
print("The Parquet files are equal.") | ||
sys.exit(0) | ||
else: | ||
print("The Parquet files are not equal.") | ||
sys.exit(1) | ||
|
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