Skip to content

Conversation

@janbuchar
Copy link
Collaborator

  • 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)

@janbuchar janbuchar added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Oct 10, 2024
@janbuchar janbuchar requested a review from vdusek October 10, 2024 13:09
@github-actions github-actions bot added this to the 100th sprint - Tooling team milestone Oct 10, 2024
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Oct 10, 2024
Copy link
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@janbuchar
Copy link
Collaborator Author

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.

Copy link
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM then

@janbuchar janbuchar merged commit fc15622 into master Oct 14, 2024
@janbuchar janbuchar deleted the storage-context-helpers branch October 14, 2024 12:42
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants