Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch exception, column output change #358

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
catch exception, column output change
rhaffar committed Nov 27, 2024
commit 90505f6e716851b6fdaeba38df5596b128ba18fd
11 changes: 5 additions & 6 deletions datacompy/snowflake.py
Original file line number Diff line number Diff line change
@@ -32,9 +32,8 @@

try:
import snowflake.snowpark as sp
from snowflake.connector.errors import ProgrammingError
from snowflake.connector.errors import DatabaseError, ProgrammingError
from snowflake.snowpark import Window
from snowflake.snowpark.exceptions import SnowparkClientException
from snowflake.snowpark.functions import (
abs,
col,
@@ -466,11 +465,11 @@ def _calculate_column_compare_stats(self, column: str, row_cnt: int) -> None:
match_cnt = match_cnt.result()
try:
max_diff = max_diff.result()[0][0]
except (SnowparkClientException, ProgrammingError):
except (ProgrammingError, DatabaseError):
max_diff = 0
try:
null_diff = null_diff.result()
except (SnowparkClientException, ProgrammingError):
except (ProgrammingError, DatabaseError):
null_diff = 0

if row_cnt > 0:
@@ -747,8 +746,8 @@ def report(
report += render(
"column_summary.txt",
len(self.intersect_columns()),
len(self.df1_unq_columns()),
len(self.df2_unq_columns()),
f"{len(self.df1_unq_columns())} {self.df1_unq_columns().items}",
f"{len(self.df2_unq_columns())} {self.df2_unq_columns().items}",
self.df1_name,
self.df2_name,
)