Repository navigation
feat: Key-value store context helpers - #584
Conversation
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?
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. |
- 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
get_key_value_store(id, name)context helper toBasicCrawlingContext