Skip to content

Commit

Permalink
Update chile bulk build_file method
Browse files Browse the repository at this point in the history
Signed-off-by: Yohanna Lisnichuk <yohanitalisnichuk@gmail.com>
  • Loading branch information
yolile committed Jun 30, 2020
1 parent ddd9e05 commit 56aad69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kingfisher_scrapy/spiders/chile_compra_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def start_requests(self):
for d in date_range_by_month(start, stop):
yield self.build_request(url.format(d), formatter=components(-1))

def build_file(self, file_name=None, url=None, data=None, data_type=None, encoding='utf-8', post_to_api=True):
def build_file(self, data=None, **kwargs):
json_data = json.loads(data)
# some files contain invalid record packages, eg:
# {
Expand All @@ -42,8 +42,8 @@ def build_file(self, file_name=None, url=None, data=None, data_type=None, encodi
if 'status' in json_data and json_data['status'] != 200:
json_data['http_code'] = json_data['status']
return FileError({
'url': url,
'url': kwargs['url'],
'errors': json_data,
})
else:
return super().build_file(data=data, file_name=file_name, url=url, data_type=data_type, encoding=encoding)
return super().build_file(data=data, **kwargs)

0 comments on commit 56aad69

Please sign in to comment.