From e0e839ba7f223c18704fa2bb30262947f423d9e0 Mon Sep 17 00:00:00 2001 From: rhaffar <141745338+rhaffar@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:37:11 -0500 Subject: [PATCH] catch exception, column output change (#358) --- datacompy/snowflake.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/datacompy/snowflake.py b/datacompy/snowflake.py index 071e355..4f9e135 100644 --- a/datacompy/snowflake.py +++ b/datacompy/snowflake.py @@ -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, )