NameError: name 'dbt_version' is not defined : diff_tables #501
Description
Describe the bug
Since yesterday I am running into this issue where diff_tables method is failing with the error "name 'dbt_version' is not defined" . Until yesterday this was running just fine. I currently do not use dbt in my script.
for different_row in diff_tables(
58 table_src,
59 table_dst,
60 update_column=p_updated_column,
61 extra_columns=p_extra_columns,
62 bisection_factor=p_bf_value,
63 threaded=p_enable_thread,
64 ):
65 plus_or_minus, records = different_row
66 logger.info(
67 f"'{plus_or_minus}', '{records}', '{p_table_name}','{p_updated_column}','{p_extra_columns}', '{p_cid}', '{datetime.now()}'"
68 ) # (‘-’, row) items in table1 but not in table2. (‘+’, row) items in table2 but not in table1.
File /local_disk0/.ephemeral_nfs/envs/pythonEnv-35af1d1a-b5c8-4d0e-a6e5-903361c72df3/lib/python3.9/site-packages/data_diff/diff_tables.py:95, in DiffResultWrapper.iter(self)
93 def iter(self):
94 yield from self.result_list
---> 95 for i in self.diff:
96 self.result_list.append(i)
97 yield i
File /local_disk0/.ephemeral_nfs/envs/pythonEnv-35af1d1a-b5c8-4d0e-a6e5-903361c72df3/lib/python3.9/site-packages/data_diff/diff_tables.py:209, in TableDiffer._diff_tables_wrapper(self, table1, table2, info_tree)
207 options = dict(self)
208 options["differ_name"] = type(self).name
--> 209 event_json = create_start_event_json(options)
210 run_as_daemon(send_event_json, event_json)
212 start = time.monotonic()
File /local_disk0/.ephemeral_nfs/envs/pythonEnv-35af1d1a-b5c8-4d0e-a6e5-903361c72df3/lib/python3.9/site-packages/data_diff/tracking.py:100, in create_start_event_json(diff_options)
86 def create_start_event_json(diff_options: Dict[str, Any]):
87 return {
88 "event": "os_diff_run_start",
89 "properties": {
90 "distinct_id": get_anonymous_id(),
91 "token": TOKEN,
92 "time": time(),
93 "os_type": os.name,
94 "os_version": platform.platform(),
95 "python_version": f"{platform.python_version()}/{platform.python_implementation()}",
96 "diff_options": diff_options,
97 "data_diff_version:": version,
98 "entrypoint_name": entrypoint_name,
99 "dbt_user_id": dbt_user_id,
--> 100 "dbt_version": dbt_version,
101 "dbt_project_id": dbt_project_id,
102 },
103 }
NameError: name 'dbt_version' is not defined
Environment:
Databricks cloud