feat: Key-value store context helpers#584
Merged
Conversation
vdusek
reviewed
Oct 14, 2024
Collaborator
vdusek
left a comment
There was a problem hiding this comment.
TBH I don't see much value in the helper function on the context just for getting the instance of KVS, when I can use just KeyValueStore.open(...), but I believe this is how things work in JS, am I right?
Collaborator
Author
Basically, yes. The main difference is this - https://github.com/apify/crawlee-python/pull/584/files#diff-a9dc84d3aa43488dab4bf2de9eba91cd58eb08d477c3fb160b87035c54deb653R713-R764 - the changes are propagated only after we know that the request handler succeeded. |
deshansh
pushed a commit
to deshansh/crawlee-python
that referenced
this pull request
Oct 19, 2024
- This adds a `get_key_value_store(id, name)` context helper to
`BasicCrawlingContext`
- Also, push_data calls are held until the request handler terminates
successfully (same as in JS version)
- This is necessary for adaptive crawling (apify#249), among other things
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.
get_key_value_store(id, name)context helper toBasicCrawlingContext