fix: Handle None text values in Claude conversations importer#353
Merged
phernandez merged 1 commit intomainfrom Oct 15, 2025
Merged
fix: Handle None text values in Claude conversations importer#353phernandez merged 1 commit intomainfrom
phernandez merged 1 commit intomainfrom
Conversation
- Add robust handling for None text values in content array - Filter out None values before joining text content - Add comprehensive test for None text values scenario - Fixes TypeError when importing conversations with null text fields Fixes #236 Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
Contributor
|
Claude finished @phernandez's task —— View job Code Review: PR #353I've completed a thorough review of this PR against Basic Memory's team checklist. Here are my findings: ✅ Code Quality & StandardsExcellent adherence to Basic Memory conventions:
Code Change Analysis ( # Filter out None values before joining
content = " ".join(
str(c.get("text", "")) for c in msg["content"]
if c and c.get("text") is not None
)The fix is well-implemented:
✅ Testing & DocumentationComprehensive test coverage:
Documentation:
✅ Basic Memory ArchitectureMaintains architectural integrity:
✅ Security & PerformanceSafe and efficient:
📋 Detailed ReviewStrengths
Observations
Minor Suggestions (Non-blocking)None - this PR is production-ready as-is. The implementation is clean, well-tested, and follows all project conventions. SummaryRecommendation: ✅ APPROVE This is a high-quality fix that:
The PR is ready to merge. |
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.
Description
This PR fixes the TypeError that occurs when importing Claude conversations containing None text values in the content array.
Problem
The importer failed with
TypeError: sequence item 2: expected str instance, NoneType foundwhen trying to join text content that included None values. This affected approximately 10% of messages in exported Claude conversations.Solution
Testing
Added comprehensive test case
test_import_conversation_with_none_text_values()that reproduces the exact scenario from issue #236 and verifies the fix works correctly.Fixes #236
Generated with Claude Code