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

Commit 2284491

Browse files
committed
make cloud diffs more responsive
1 parent 50bac04 commit 2284491

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

data_diff/dbt.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def dbt_diff(
118118
"Datasource ID not found, include it as a dbt variable in the dbt_project.yml. "
119119
"\nvars:\n data_diff:\n datasource_id: 1234"
120120
)
121+
rich.print("[green][bold]\nDiffs in progress...[/][/]\n")
121122

122123
else:
123124
dbt_parser.set_connection()
@@ -288,14 +289,14 @@ def _cloud_diff(diff_vars: DiffVars, datasource_id: int, api: DatafoldAPI) -> No
288289
diff_url = None
289290
try:
290291
diff_id = api.create_data_diff(payload=payload)
292+
diff_url = f"{api.host}/datadiffs/{diff_id}/overview"
293+
rich.print(f"{diff_vars.dev_path[2]}: {diff_url}")
291294

292295
if diff_id is None:
293296
raise Exception(f"Api response did not contain a diff_id")
294297

295298
diff_results = api.poll_data_diff_results(diff_id)
296299

297-
diff_url = f"{api.host}/datadiffs/{diff_id}/overview"
298-
299300
rows_added_count = diff_results.pks.exclusives[1]
300301
rows_removed_count = diff_results.pks.exclusives[0]
301302

@@ -352,4 +353,4 @@ def _cloud_diff(diff_vars: DiffVars, datasource_id: int, api: DatafoldAPI) -> No
352353

353354

354355
def _diff_output_base(dev_path: str, prod_path: str) -> str:
355-
return f"[green]{prod_path} <> {dev_path}[/] \n"
356+
return f"\n[green]{prod_path} <> {dev_path}[/] \n"

0 commit comments

Comments
 (0)