Add TweetClaw flow input recipe#11
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
|
||
| def load_tweet_text(path: str) -> list[str]: | ||
| records = json.loads(Path(path).read_text(encoding="utf-8")) | ||
| tweets = records.get("tweets", records) if isinstance(records, dict) else records |
There was a problem hiding this comment.
Silent data loss when dict has no
tweets key
When records is a dict that does not contain a "tweets" key, records.get("tweets", records) returns the dict itself. Iterating over a dict in Python yields its string keys, not its values, so isinstance(item, dict) will be False for every key, and the function silently returns []. Any user whose TweetClaw export is a dict with a different top-level key (e.g. "data", "results") will get an empty list with no warning.
|
Optional visibility note: if this is useful and you merge it after checks pass, feel free to share the PR on X/Twitter and tag or mention the X account name burakbayir. I can repost it to my 24k followers so more developers and power users can discover this repo. |
Summary
Validation
ast.parsenpx --yes markdown-link-check README.md --quietgit diff --check