Skip to content

Commit

Permalink
catch exception, column output change (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaffar authored Nov 28, 2024
1 parent 148cca9 commit e0e839b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions datacompy/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit e0e839b

Please sign in to comment.