Repository navigation
fix!: write storage data with camelCase keys - #2320
Merged
Merged
Conversation
BREAKING CHANGE: Storage clients write metadata and request JSON with camelCase keys. Data written by v1 still loads.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #2320 +/- ##
=====================================
Coverage ? 94.12%
=====================================
Files ? 183
Lines ? 13558
Branches ? 0
=====================================
Hits ? 12762
Misses ? 796
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
October 13, 2026 13:13
vdusek
added a commit
that referenced
this pull request
Oct 16, 2026
The storage clients wrote their JSON with snake_case keys because `model_dump()` was called without `by_alias=True`, although the models declare camelCase aliases matching Crawlee JS. This PR dumps by alias everywhere data is persisted: - `FileSystemStorageClient`: dataset, KVS and RQ metadata files, request files and KVS record metadata files. - `RedisStorageClient` and `SqlStorageClient`: request JSON, plus the KVS record metadata in Redis. The Redis storage metadata documents stay snake_case. The client updates them in place through RedisJSON paths such as `$.item_count`, so renaming those keys would break existing Redis data. Data written by v1 still loads, because the models validate by field name as well as by alias. A new test rewrites an RQ's files in the v1 format, reopens it and checks the metadata and requests. The v2 upgrade guide has a section on the change. Closes: #1844 *✍️ Drafted by Claude Code*
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.
The storage clients wrote their JSON with snake_case keys because
model_dump()was called withoutby_alias=True, although the models declare camelCase aliases matching Crawlee JS. This PR dumps by alias everywhere data is persisted:FileSystemStorageClient: dataset, KVS and RQ metadata files, request files and KVS record metadata files.RedisStorageClientandSqlStorageClient: request JSON, plus the KVS record metadata in Redis.The Redis storage metadata documents stay snake_case. The client updates them in place through RedisJSON paths such as
$.item_count, so renaming those keys would break existing Redis data.Data written by v1 still loads, because the models validate by field name as well as by alias. A new test rewrites an RQ's files in the v1 format, reopens it and checks the metadata and requests. The v2 upgrade guide has a section on the change.
Closes: #1844
✍️ Drafted by Claude Code