pythonplotlydependencieskedro

Kedro (Python) DeprecationWarning: `np.bool8`


When I try to create a new kedro project or run an existing one, I get the following deprecation warning (see also screenshot below). As far as I understand the warning is neglebile, however, as I am trying to setup a clean project, I would like to resolve this warning. From the warning I get that it stems from the ploltly package which apparently uses the old np.bool8 over the new np.bool_

WARNING  D:\Code\Python\kedro-tutorial\.venv\lib\site-packages\plotly\express\imshow_utils.py:24:                 warnings.py:109                             DeprecationWarning: `np.bool8` is a deprecated alias for `np.bool_`.  (Deprecated NumPy 1.24)
                               np.bool8: (False, True),

Thus I tried to upgrade plotly, but it seems like it is already on the newest version

pip install --upgrade plotly
Requirement already satisfied: plotly in d:\code\python\kedro-tutorial\.venv\lib\site-packages (5.11.0)
Requirement already satisfied: tenacity>=6.2.0 in d:\code\python\kedro-tutorial\.venv\lib\site-packages (from plotly) (8.1.0)

enter image description here

Is there anyway to resolve this warning, despite not using the plotly package at all?


Solution

  • This warning is indeed harmless and you can ignore it. I also found that in any new environment I created with Python 3.7, 3.8 or 3.9 it didn't appear. So you could try and see if a new environment solves it.

    Otherwise, you could add this piece of code to ignore it:

    from warnings import filterwarnings
    filterwarnings(action='ignore', category=DeprecationWarning, message='`np.bool` is a deprecated alias')
    

    We always aim to keep Kedro and its dependencies as up to date as possible, so we'll make sure to add a better solution for this when available.