-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: remove non-native MongoDB storage option #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove the `native_storage` parameter from MongoDBStore and related code. The store now exclusively uses native BSON storage for better query support and performance. Legacy JSON string data can still be read for backward compatibility. Changes: - Removed `native_storage` parameter from MongoDBStore __init__ - Simplified MongoDBSerializationAdapter to always use BSON dict storage - Maintained legacy JSON string read support in prepare_load() - Updated tests to remove non-native mode test class - Consolidated tests into single TestMongoDBStore class - Updated test names to reflect current functionality Fixes #212 Co-authored-by: William Easton <strawgate@users.noreply.github.com>
📝 WalkthroughWalkthroughRemoves the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant MongoDBStore
participant MongoDBSerializationAdapter
participant MongoDB
Note over MongoDBSerializationAdapter: BSON dict storage only
rect rgb(240,248,255)
Note over Client,MongoDB: Store (write)
Client->>MongoDBStore: set(key, value)
MongoDBStore->>MongoDBSerializationAdapter: prepare_dump(value)
MongoDBSerializationAdapter->>MongoDBSerializationAdapter: data["value"] = {"object": value}
MongoDBSerializationAdapter-->>MongoDBStore: BSON document
MongoDBStore->>MongoDB: insert document
end
rect rgb(240,255,240)
Note over Client,MongoDB: Load (read)
Client->>MongoDBStore: get(key)
MongoDB->>MongoDBStore: BSON document
MongoDBStore->>MongoDBSerializationAdapter: prepare_load(document)
MongoDBSerializationAdapter->>MongoDBSerializationAdapter: read data["value"]["object"] (error if missing)
MongoDBSerializationAdapter-->>MongoDBStore: deserialized value
MongoDBStore-->>Client: value
end
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)key-value/key-value-aio/tests/stores/mongodb/test_mongodb.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@claude this is an unstable store, remove the backwards compat please |
|
Claude finished @strawgate's task —— View job Removed backward compatibility from MongoDB store ✓Successfully removed the backward compatibility code for legacy JSON string storage from the MongoDB store. Changes Made
SummaryThe MongoDB store now exclusively uses native BSON dictionary storage with no support for reading legacy JSON string data. This is a breaking change for any existing deployments with legacy data, but is acceptable since MongoDB is marked as an unstable store. The Branch • |
…e in MongoDB Remove the ability to read legacy JSON string data format in MongoDBStore. Since this is an unstable store, breaking changes are acceptable. Changes: - Remove legacy JSON string read support from prepare_load() - Remove backward compatibility documentation - Remove test_legacy_document_compatibility test - Remove test_migration_from_legacy_mode integration test - Update sync library via codegen Co-authored-by: William Easton <strawgate@users.noreply.github.com>
|


Summary
Removes the
native_storageparameter from MongoDBStore and simplifies the codebase. The store now exclusively uses native BSON storage for better query support and performance, while maintaining backward compatibility for reading legacy JSON string data.Changes
native_storageparameter from MongoDBStore initBackward Compatibility
✅ Legacy JSON string data can still be read via
prepare_load()Fixes #212
Generated with Claude Code) • Branch • [View job run](https://github.com/strawgate/py-key-value/actions/runs/19187564782
Summary by CodeRabbit
Breaking Changes
Behavior Changes
Tests
Documentation