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

Commit 91e1d98

Browse files
authored
reverse order of dev and prod tables in cli printout and cloud diffs (#389)
* reverse order of dev and prod tables in cli printout and cloud diffs * reverse order of table1 and table2 in tests
1 parent 29bfa73 commit 91e1d98

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

data_diff/dbt.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def dbt_diff(
6565
elif is_cloud:
6666
rich.print(
6767
"[red]"
68-
+ ".".join(diff_vars.dev_path)
69-
+ " <> "
7068
+ ".".join(diff_vars.prod_path)
69+
+ " <> "
70+
+ ".".join(diff_vars.dev_path)
7171
+ "[/] \n"
7272
+ "Skipped due to missing primary-key tag\n"
7373
)
@@ -77,9 +77,9 @@ def dbt_diff(
7777
elif not is_cloud:
7878
rich.print(
7979
"[red]"
80-
+ ".".join(diff_vars.dev_path)
81-
+ " <> "
8280
+ ".".join(diff_vars.prod_path)
81+
+ " <> "
82+
+ ".".join(diff_vars.dev_path)
8383
+ "[/] \n"
8484
+ "Skipped due to missing primary-key tag or multi-column primary-key (unsupported for non --cloud diffs)\n"
8585
)
@@ -129,9 +129,9 @@ def _local_diff(diff_vars: DiffVars) -> None:
129129
logging.info(ex)
130130
rich.print(
131131
"[red]"
132-
+ dev_qualified_string
133-
+ " <> "
134132
+ prod_qualified_string
133+
+ " <> "
134+
+ dev_qualified_string
135135
+ "[/] \n"
136136
+ column_diffs_str
137137
+ "[green]New model or no access to prod table.[/] \n"
@@ -156,9 +156,9 @@ def _local_diff(diff_vars: DiffVars) -> None:
156156
if list(diff):
157157
rich.print(
158158
"[red]"
159-
+ dev_qualified_string
160-
+ " <> "
161159
+ prod_qualified_string
160+
+ " <> "
161+
+ dev_qualified_string
162162
+ "[/] \n"
163163
+ column_diffs_str
164164
+ diff.get_stats_string(is_dbt=True)
@@ -167,9 +167,9 @@ def _local_diff(diff_vars: DiffVars) -> None:
167167
else:
168168
rich.print(
169169
"[red]"
170-
+ dev_qualified_string
171-
+ " <> "
172170
+ prod_qualified_string
171+
+ " <> "
172+
+ dev_qualified_string
173173
+ "[/] \n"
174174
+ column_diffs_str
175175
+ "[green]No row differences[/] \n"
@@ -191,8 +191,8 @@ def _cloud_diff(diff_vars: DiffVars) -> None:
191191
payload = {
192192
"data_source1_id": diff_vars.datasource_id,
193193
"data_source2_id": diff_vars.datasource_id,
194-
"table1": diff_vars.dev_path,
195-
"table2": diff_vars.prod_path,
194+
"table1": diff_vars.prod_path,
195+
"table2": diff_vars.dev_path,
196196
"pk_columns": diff_vars.primary_keys,
197197
}
198198

@@ -216,9 +216,9 @@ def _cloud_diff(diff_vars: DiffVars) -> None:
216216
diff_url = f"https://app.datafold.com/datadiffs/{diff_id}/overview"
217217
rich.print(
218218
"[red]"
219-
+ ".".join(diff_vars.dev_path)
220-
+ " <> "
221219
+ ".".join(diff_vars.prod_path)
220+
+ " <> "
221+
+ ".".join(diff_vars.dev_path)
222222
+ "[/] \n Diff in progress: \n "
223223
+ diff_url
224224
+ "\n"

tests/test_dbt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ def test_cloud_diff(self, mock_request, mock_os_environ, mock_print):
425425
)
426426
self.assertEqual(request_data_dict["data_source1_id"], expected_datasource_id)
427427
self.assertEqual(request_data_dict["data_source2_id"], expected_datasource_id)
428-
self.assertEqual(request_data_dict["table1"], dev_qualified_list)
429-
self.assertEqual(request_data_dict["table2"], prod_qualified_list)
428+
self.assertEqual(request_data_dict["table1"], prod_qualified_list)
429+
self.assertEqual(request_data_dict["table2"], dev_qualified_list)
430430
self.assertEqual(request_data_dict["pk_columns"], expected_primary_keys)
431431

432432
@patch("data_diff.dbt.rich.print")

0 commit comments

Comments
 (0)