From 56aad6968b4a0869cb9749daa102aac088782b62 Mon Sep 17 00:00:00 2001 From: Yohanna Lisnichuk Date: Tue, 30 Jun 2020 09:33:41 -0400 Subject: [PATCH] Update chile bulk build_file method Signed-off-by: Yohanna Lisnichuk --- kingfisher_scrapy/spiders/chile_compra_bulk.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kingfisher_scrapy/spiders/chile_compra_bulk.py b/kingfisher_scrapy/spiders/chile_compra_bulk.py index 75db76f71..a935a1fa0 100644 --- a/kingfisher_scrapy/spiders/chile_compra_bulk.py +++ b/kingfisher_scrapy/spiders/chile_compra_bulk.py @@ -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: # { @@ -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)