Skip non-Messenger JSONs in get_fb_messages instead of crashing - #412
Merged
Conversation
The artifact's glob is */*.json, so in any return package it matches every JSON file, then assumed the Facebook Messenger export shape. On a Google Takeout the first foreign JSON killed the whole artifact: a top-level list raised AttributeError on .get, and a dict without a participants list raised TypeError on participants[0]. Found sweeping a newly registered 2021 Google Takeout corpus. Guard the shape instead: skip files that fail to parse as JSON, are not a dict, or lack a non-empty participants list and a messages list. Real Messenger exports parse unchanged (validated with a Messenger-shaped export round-trip: 2 messages, conversation columns intact - shape-verified, not corpus-verified, since no registered corpus carries a Messenger E2E export yet). The full Takeout sweep goes from an artifact-killing traceback to a clean run with zero error lines. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_fb_messages globs /.json, so in any return package it matches every JSON and then assumed the Messenger export shape. On a Google Takeout the first foreign JSON killed the artifact: a top-level list raised AttributeError on .get, and a dict without participants raised TypeError on participants[0].
Guard the shape: skip files that fail to parse, are not a dict, or lack a non-empty participants list and a messages list. A real Messenger-shaped export still parses (round-trip validated, 2 messages with conversation columns intact; shape-verified rather than corpus-verified since no registered corpus carries a Messenger E2E export yet). A full RLEAPP run over a 2021 Google Takeout goes from an artifact-killing traceback to zero error lines, with the correct empty result for Facebook Messenger.
🤖 Generated with Claude Code