-
Notifications
You must be signed in to change notification settings - Fork 513
feat: Split and add extra configuration to export_data method #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Split and add extra configuration to export_data method #580
Conversation
vdusek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! I have a few comments...
Regarding the removal of export_data, I'm not sure we should do that. Removing it would break parity with the JS Crawlee and introduce a breaking change (in which case, you'd need to use the feat! commit prefix).
Maybe we can keep the export_data and call the appropriate methods within it, like this:
async def export_data(
self,
path: str | Path,
*,
content_type: Literal['csv', 'json'] = 'csv',
dataset_id: str | None = None,
dataset_name: str | None = None,
**kwargs: Any,
) -> None:
if content_type == 'csv':
self.export_data_csv(path, dataset_id=dataset_id, dataset_name=dataset_name, **kwargs)
elif content_type == 'json':
self.export_data_json(path, dataset_id=dataset_id, dataset_name=dataset_name, **kwargs)
else:
raise ValueError(f'Unsupported content type: {content_type}.')- 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
- rm unused pipeline - use env var for node versions (same as we do for python)
vdusek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
hi @deshansh can you please send me your email or ping me on apify discord? |
Description
Issues
Testing
Checklist