Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 0049bc1

Browse files
authored
Merge pull request #632 from datafold/check_prod_table_access
check prod table for DNE/access exception
2 parents e1ce08f + 708726d commit 0049bc1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

data_diff/dbt.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,17 @@ def _local_diff(diff_vars: TDiffVars, json_output: bool = False) -> None:
245245
)
246246
table2 = connect_to_table(diff_vars.connection, dev_qualified_str, tuple(diff_vars.primary_keys), diff_vars.threads)
247247

248-
table1_columns = table1.get_schema()
249248
try:
250-
table2_columns = table2.get_schema()
249+
table1_columns = table1.get_schema()
251250
# Not ideal, but we don't have more specific exceptions yet
252251
except Exception as ex:
253252
logger.debug(ex)
254253
diff_output_str += "[red]New model or no access to prod table.[/] \n"
255254
rich.print(diff_output_str)
256255
return
257256

257+
table2_columns = table2.get_schema()
258+
258259
table1_column_names = set(table1_columns.keys())
259260
table2_column_names = set(table2_columns.keys())
260261
column_set = table1_column_names.intersection(table2_column_names)

0 commit comments

Comments
 (0)