DeprecationWarning cannot be blocked or filtered

How severe does this issue affect your experience of using Ray?

  • Low: It annoys or frustrates me for a moment.

I have been using ray[rllib, tune, serve]==2.7.0 for a project and have not found a way to block or filter DeprecationWarnings from the package. Even when importing, there is a deprecation warning like the following:

DeprecationWarning: DirectStepOptimizer has been deprecated. This will raise an error in the future!

This is not an issue that stops development efforts, but it clogs outputs and logging. We are not planning on using any other package version so I don’t believe there is any risk involved with blocking or filtering this warning.

I’ve attempted three things:
1:
import warnings
warnings.filterwarnings("ignore")

2:
import sys
import os
sys.stderr = open(os.devnull, 'w')
import packages…
sys.stderr.close()

3:
import ray
import logging
ray.init(logging_level=logging.ERROR)

None of these have resulted in changing the output of Deprecation Warnings. Any advice would be greatly appreciated.