我正在从 powerpi 的“/export”端点导出大型数据集?下载和写入大约 800MB 的 .pbix 文件需要超过 5 小时。我们怎样才能在几分钟内减少它?
with requests.get(url, headers=headers, params=params, stream=True) as response:
response.raise_for_status()
with open(pbix_fileName, 'wb') as report_file:
for chunk in response.iter_content(chunk_size=1024 * 8): # 1MB chunks
if chunk:
report_file.write(chunk)
report_file.flush()
os.fsync(report_file.fileno())
print("success!")