diff --git a/data_diff/diff_tables.py b/data_diff/diff_tables.py index 74376f63..0086b878 100644 --- a/data_diff/diff_tables.py +++ b/data_diff/diff_tables.py @@ -213,6 +213,8 @@ def diff_tables(self, table1: TableSegment, table2: TableSegment, info_tree: Inf def _diff_tables_wrapper(self, table1: TableSegment, table2: TableSegment, info_tree: InfoTree) -> DiffResult: if is_tracking_enabled(): options = attrs.asdict(self, recurse=False) + # not a useful event attribute + options.pop("_ignored_columns_lock") options["differ_name"] = type(self).__name__ event_json = create_start_event_json(options) run_as_daemon(send_event_json, event_json) diff --git a/data_diff/tracking.py b/data_diff/tracking.py index 0fad464a..2f2a3370 100644 --- a/data_diff/tracking.py +++ b/data_diff/tracking.py @@ -201,10 +201,27 @@ def create_email_signup_event_json(email: str) -> Dict[str, Any]: } +def convert_sets_to_lists(obj): + """ + Recursively convert sets in the given object to lists. + """ + if isinstance(obj, set): + return list(obj) + elif isinstance(obj, dict): + return {k: convert_sets_to_lists(v) for k, v in obj.items()} + elif isinstance(obj, list): + return [convert_sets_to_lists(elem) for elem in obj] + else: + return obj + + def send_event_json(event_json) -> None: if not g_tracking_enabled: raise RuntimeError("Won't send; tracking is disabled!") + # Convert sets to lists in event_json + event_json = convert_sets_to_lists(event_json) + headers = { "Content-Type": "application/json", "Authorization": "Basic MkhndE00SGNxOUJtZWlDcU5ZaHo3Tzl0a2pNOg==",