MCPcopy Create free account
hub / github.com/dbt-labs/ade-bench / save_diff_log

Method save_diff_log

ade_bench/handlers/file_diff_handler.py:307–326  ·  view source on GitHub ↗

Save the diff log to file.

(self)

Source from the content-addressed store, hash-verified

305 return None
306
307 def save_diff_log(self):
308 """Save the diff log to file."""
309 if not self.enabled or not self.diffs:
310 return
311
312 try:
313 # Save detailed diff data as JSON with optimized structure
314 diff_data = {
315 "content_manager": self.content_manager.to_dict(),
316 "snapshots": [snapshot.to_dict() for snapshot in self.snapshots],
317 "diffs": [diff.to_dict() for diff in self.diffs],
318 }
319
320 self.diff_log_path.write_text(json.dumps(diff_data, indent=2))
321
322 # Save human-readable summary
323 self._save_diff_summary()
324
325 except Exception as e:
326 self._logger.error(f"Error saving diff log: {e}")
327
328 def _save_diff_summary(self):
329 """Save a human-readable summary of file changes."""

Callers 1

_run_trialMethod · 0.95

Calls 2

_save_diff_summaryMethod · 0.95
to_dictMethod · 0.45

Tested by

no test coverage detected