diff --git a/changelog/11173.misc.md b/changelog/11173.misc.md new file mode 100644 index 000000000000..4d017341cf06 --- /dev/null +++ b/changelog/11173.misc.md @@ -0,0 +1 @@ +Silence noisy deprecation warnings about Pillow methods generated by keras-preprocessing. \ No newline at end of file diff --git a/rasa/utils/common.py b/rasa/utils/common.py index bc4ce03677ec..5b8df4288d9d 100644 --- a/rasa/utils/common.py +++ b/rasa/utils/common.py @@ -38,6 +38,13 @@ T = TypeVar("T") +EXPECTED_PILLOW_DEPRECATION_WARNINGS = [ + # Keras uses deprecated Pillow features + # cf. https://github.com/keras-team/keras/issues/16639 + (DeprecationWarning, f"{method} is deprecated and will be removed in Pillow 10 .*") + for method in ["BICUBIC", "NEAREST", "BILINEAR", "HAMMING", "BOX", "LANCZOS"] +] + EXPECTED_WARNINGS = [ # TODO (issue #9932) ( @@ -51,7 +58,12 @@ "shape. This may consume a large amount of memory.", ), (UserWarning, "Slot auto-fill has been removed in 3.0 .*"), -] + # This warning is caused by the flatbuffers package + # The import was fixed on Github, but the latest version + # is not available on PyPi, so we cannot pin the newer version. + # cf. https://github.com/google/flatbuffers/issues/6957 + (DeprecationWarning, "the imp module is deprecated in favour of importlib.*"), +] + EXPECTED_PILLOW_DEPRECATION_WARNINGS class TempDirectoryPath(str, ContextManager):