You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new FeedExporter class doesn't allow to pass custom info to ItemExporter through the FEEDS setting.
Motivation
My use-case is a bit too long to describe, but it can be minimized to the following: for example, I have a custom ItemExporter which I want to have different options for different feeds. Say I want to pass custom param option to it.
classCustomItemExporter(BaseItemExporter):
def_configure(self, options, dont_fail=False):
super()._configure(options, dont_fail)
self.param=options.pop('param', None)
defexport_item(self, item):
# Using self.param here
...
The only workaround I've found was to create a new FeedExporter class and override open_spider method to pass feed['item_export_kwargs'] to _get_exporter method.
Additional context
Will provide a PR this week.
The text was updated successfully, but these errors were encountered:
@Gallaecio if I understand the changes correctly, it is now possible to pass it to FeedStorage. What I want, though, is passing custom args to ItemExporters.
Summary
The new FeedExporter class doesn't allow to pass custom info to ItemExporter through the
FEEDS
setting.Motivation
My use-case is a bit too long to describe, but it can be minimized to the following: for example, I have a custom ItemExporter which I want to have different options for different feeds. Say I want to pass custom
param
option to it.Ideally, I would like to do set it like this:
Describe alternatives you've considered
The only workaround I've found was to create a new FeedExporter class and override
open_spider
method to passfeed['item_export_kwargs']
to_get_exporter
method.Additional context
Will provide a PR this week.
The text was updated successfully, but these errors were encountered: