Repository navigation
Conversation
Two crawlers with the same explicit `id` silently overwrite each other's state, so the second one now raises `ValueError` during construction. The id is registered only after the constructor succeeds, so a failed construction can be retried with the same id. Aligned with apify/crawlee#4516. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHmkSj1CsSHvZFwiuZ
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2572 +/- ##
==========================================
- Coverage 94.31% 94.21% -0.10%
==========================================
Files 184 185 +1
Lines 13787 13802 +15
==========================================
+ Hits 13003 13004 +1
- Misses 784 798 +14
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:
|
`crawlee.storages.use_state` returns an auto-saved dictionary under an explicit key of a key-value store, so several crawlers can share state without reusing a crawler `id`. Mirrors `useState()` from the JS version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHmkSj1CsSHvZFwiuZ
use_state
This branch has not been deployed
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.
Creating a
BasicCrawlerwith an explicitidthat another crawler already uses now raisesValueError, since the two would overwrite each other's state (JS issue: apify/crawlee#4516).To share state between crawlers, use the new standalone
crawlee.storages.use_state(key)with an explicit key, mirroring JSuseState().https://claude.ai/code/session_017ocuAHmkSj1CsSHvZFwiuZ
Generated by Claude Code