Fix cache loading with Report.from_dict() method
The Report.to_dict() serializes range as {from, to} but constructor
expects range_from/range_to. Added from_dict() classmethod to properly
deserialize cached data, reconstructing all nested objects (Engagement,
Comment, SubScores, RedditItem, XItem).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -211,7 +211,7 @@ def main():
|
||||
cached = cache.load_cache(cache_key)
|
||||
if cached:
|
||||
# Use cached data
|
||||
report = schema.Report(**cached)
|
||||
report = schema.Report.from_dict(cached)
|
||||
output_result(report, args.emit)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user