SAIS-CARI conversion fails when source-data is empty before download
When fetcher is called with an empty source data before download, this error occurs:
+ python download.py /workspace/fetcher-source-data
+ python convert.py /workspace/fetcher-source-data /workspace/fetcher-json-data
Traceback (most recent call last):
File "convert.py", line 418, in <module>
sys.exit(main())
File "convert.py", line 387, in main
dataset_info_list.extend(generate_datasets_from_description(dr.DATASET_PROCESS_DATA, source_dir, target_dir))
File "convert.py", line 226, in generate_datasets_from_description
dataset_info_list.append(func(target_dir, excel_filepath, sheet_name, sheet_header, ds_info))
File "convert.py", line 116, in generate_annual_column_dataset
df = pd.read_excel(str(excel_filepath), sheet_name=sheet_name, header=header_lineid)
File "/usr/local/lib/python3.8/site-packages/pandas/util/_decorators.py", line 296, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pandas/io/excel/_base.py", line 304, in read_excel
io = ExcelFile(io, engine=engine)
File "/usr/local/lib/python3.8/site-packages/pandas/io/excel/_base.py", line 867, in __init__
self._reader = self._engines[engine](self._io)
File "/usr/local/lib/python3.8/site-packages/pandas/io/excel/_xlrd.py", line 22, in __init__
super().__init__(filepath_or_buffer)
File "/usr/local/lib/python3.8/site-packages/pandas/io/excel/_base.py", line 353, in __init__
self.book = self.load_workbook(filepath_or_buffer)
File "/usr/local/lib/python3.8/site-packages/pandas/io/excel/_xlrd.py", line 37, in load_workbook
return open_workbook(filepath_or_buffer)
File "/usr/local/lib/python3.8/site-packages/xlrd/__init__.py", line 111, in open_workbook
with open(filename, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/workspace/fetcher-source-data/data-chinese-loans-and-aid-to-africa/data-chinese-loans-and-aid-to-africa.xlsx'