print("%i CNPJ\"s to be fetched" % len(cnpj_list_to_import))
with futures.ThreadPoolExecutor(max_workers=10) as executor:
future_to_cnpj_info = dict((executor.submit(fetch_cnpj_info, cnpj), cnpj)
for cnpj in cnpj_list)
for future in futures.as_completed(future_to_cnpj_info):
After Change
print("%i CNPJ\"s to be fetched" % len(cnpj_list_to_import))
for cnpj in cnpj_list[:3]:
result = fetch_cnpj_info(cnpj)
if result != None and result["status"] == "OK":
info_dataset = info_dataset.append(result, ignore_index=True)