This is a meta-issue as part of #9999. Here, I catalog the current list of test files that raise a FutureWarning.
The use of a FutureWarning indicates a deprecated API, mostly from cudf or pandas. We should explicitly catch or filter out these warnings, depending on the circumstances. Eventually we will be able to run pytest -W error::FutureWarning to catch any deprecated APIs being called by our tests, which may conceal a regression in the user API.
I traced down some unexpected behavior and it turns out to be an error in the Python docs. This comment explains what I found, for posterity/reference. cc: @galipremsagar
I tried to specify a warning filter pytest -W error::FutureWarning:cudf.* on the command line. This follows the guidelines for how to specify warning filters as action:message:category:module:line.
I expected that this would raise an error for any FutureWarning raised by the cudf module or its subpackages, by interpreting the cudf.* module string as a regular expression. However, we can't do this with -W, because the input strings for message and module are escaped and not interpreted as regular expressions when defined with -W or PYTHONWARNINGS. The docs indicate that the module string is always treated as a regular expression, but that is only true for warnings.filterwarnings and not the command line option -W or environment variable PYTHONWARNINGS. This problem in the docs was reported in https://bugs.python.org/issue42272 and fixed in python/cpython#23172.
The workaround for this is to define this in our pytest configuration, setup.cfg, with the following:
This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.
This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.
Activity
Fix warnings in test_cuda_apply, test_numerical, test_pickling, test_…
Fix warnings in `test_rolling` (#10405)
Fix some warnings in `test_parquet.py` (#10416)
Remove warnings in `test_timedelta.py` (#10418)
bdice commented on Mar 12, 2022
I traced down some unexpected behavior and it turns out to be an error in the Python docs. This comment explains what I found, for posterity/reference. cc: @galipremsagar
I tried to specify a warning filter pytest -W error::FutureWarning:cudf.* on the command line. This follows the guidelines for how to specify warning filters as action:message:category:module:line.
I expected that this would raise an error for any FutureWarning raised by the cudf module or its subpackages, by interpreting the cudf.* module string as a regular expression. However, we can't do this with -W, because the input strings for message and module are escaped and not interpreted as regular expressions when defined with -W or PYTHONWARNINGS. The docs indicate that the module string is always treated as a regular expression, but that is only true for warnings.filterwarnings and not the command line option -W or environment variable PYTHONWARNINGS. This problem in the docs was reported in https://bugs.python.org/issue42272 and fixed in python/cpython#23172.
The workaround for this is to define this in our pytest configuration, setup.cfg, with the following:
References:
github-actions commented on Apr 11, 2022
This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.
github-actions commented on Jul 10, 2022
This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.
Fix warnings in test_stats.py (#12293)
Fix warnings in test_indexing.py (#12305)
Fix warnings in test_joining.py (#12304)
Fix warnings in test_multiindex.py (#12310)
Fix warnings in test_orc.py (#12326)
Fix warnings in test_index.py (#12313)
Fix warnings in test_groupby.py (#12324)
Fix warnings in test_monotonic.py (#12334)
Fix warnings in test modules up to test_dataframe.py (#12355)
Fix warnings in test_datetime.py (#12381)
Fix warnings in dataframe.py (#12369)
Fix warnings in remaining modules (#12406)