python - 使用 dask.dataframe 读取 csv 的奇怪警告
问题描述
我正在使用 dask 数据框模块来读取 csv。
In [3]: from dask import dataframe as dd
In [4]: dd.read_csv("/file.csv", sep=",", dtype=str, encoding="utf-8", error_bad_lines=False, collection=True, blocksize=64e6)
我以前没有问题,但是今天出现了一个奇怪的警告:
FutureWarning: The default value of auto_mkdir=True has been deprecated and will be changed to auto_mkdir=False by default in a future release.
FutureWarning,
直到我意识到它破坏了我的单元测试,这才让我担心,因为当从控制台使用它时,它只是一个简单的警告,但是为我的应用程序设置的测试因此而破坏了。
有谁知道这个警告的原因或如何摆脱它?
解决方案
文档自动回复:
- 此问题出现在 fsspec==0.6.3 和 dask==2.12.0 中,将来会被删除。
- 为防止 pytest 由于警告而失败,
pytest.ini
请在项目中添加或编辑文件并设置
filterwarnings =
error
ignore::UserWarning
- 如果您希望 dask 完全消除警告,请在函数调用中显式设置它
storage_options=dict("auto_mkdir"=True)
推荐阅读
- javascript - *ngFor 带有多个图像标签 - 如何知道所有图像 src 何时加载
- php - 如何使用codeigniter中的会话ID从表中检索数据
- c++ - 如何在 gdb 中检查 C++ 向量中的元素?
- java - 守护进程的Android Studio问题
- python - 如何在具有多层的python(colab)中读取文件?
- c# - 如何在开发过程中在主体上下文上公开 EmailAddress 属性
- terraform - 如何在脚本中使用 terraform 输出
- c# - 如何让 Nunit 测试适配器框架与 .netcore 3.1 一起使用
- python - 我正在研究一个机器学习模型来预测促销,这个块引发了一个错误,即“TypeError: None is not an estimator instance”。
- javascript - 基于值js过滤对象的对象