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
If I make a dataclass item and want to export to csv, I get this error:
...
File "/home/tadej/miniconda3/envs/main/lib/python3.7/site-packages/scrapy/exporters.py", line 251, in _write_headers_and_set_fields_to_export
self.fields_to_export = list(item.fields.keys())
AttributeError: 'CompanyItem' object has no attribute 'fields'
Description
If I make a
dataclass
item and want to export to csv, I get this error:The problem stems from here
https://github.com/scrapy/scrapy/blob/master/scrapy/exporters.py#L243-L253
There should be an additional if case checking if the item is of type dataclass, and then accessing the fields differently, perhaps as
The text was updated successfully, but these errors were encountered: