【发布时间】:2020-03-19 20:49:37
【问题描述】:
我正在使用 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,
直到我意识到它破坏了我的单元测试时我才担心,因为当从控制台使用它时,它只是一个简单的警告,但为我的应用设置的测试因此而破坏了。
有谁知道这个警告的原因或如何消除它?
【问题讨论】:
-
您最近更新了 dask 版本吗?还是您使用的是在线 jupyter notebook?
-
猜测,但如果您在 read_csv 函数中设置 auto_mkdir=True 会发生什么?
-
@d_kennetz 我正在使用 dask 2.12,最新版本,尚未更改
-
@boomkin 已经尝试过,但会引发错误:auto_mkdir is not a valid kwarg for read_csv
-
我已经通过在我的 pytest.ini 中设置:filterwarnings = error ignore::FutureWarning 暂时解决了这个问题,但我仍然觉得这个警告不应该发生
标签: python warnings pytest dask future-warning