Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overview Page gives error on load #227

Open
andytinkham opened this issue Apr 10, 2024 · 4 comments
Open

Overview Page gives error on load #227

andytinkham opened this issue Apr 10, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@andytinkham
Copy link

andytinkham commented Apr 10, 2024

I just started running IoT Inspector. It's been running and collecting data, I've named devices and I can go into the device details and see individual domain references. When I go to the Overview page, though, I get this error:

ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Traceback:
File "iot-inspector-client/env/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 584, in _run_script
    exec(code, module.__dict__)
File "iot-inspector-client/ui/pages/1_Overview.py", line 362, in <module>
    main()
File "iot-inspector-client/ui/pages/1_Overview.py", line 76, in main
    show_activity_graph(
File "iot-inspector-client/env/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py", line 168, in wrapper
    return cached_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py", line 199, in __call__
    return self._get_or_create_cached_value(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py", line 224, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py", line 280, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/ui/pages/1_Overview.py", line 173, in show_activity_graph
    fig = px.bar(
          ^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/plotly/express/_chart_types.py", line 373, in bar
    return make_figure(
           ^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/plotly/express/_core.py", line 2090, in make_figure
    args = build_dataframe(args, constructor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/plotly/express/_core.py", line 1492, in build_dataframe
    df_output, wide_id_vars = process_args_into_dataframe(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/plotly/express/_core.py", line 1228, in process_args_into_dataframe
    df_output[col_name] = to_unindexed_series(
                          ^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/plotly/express/_core.py", line 1076, in to_unindexed_series
    return pd.Series(x, name=name).reset_index(drop=True)
           ^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/pandas/core/series.py", line 537, in __init__
    data, index = self._init_dict(data, index, dtype)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/pandas/core/series.py", line 632, in _init_dict
    if data:
       ^^^^
File "iot-inspector-client/env/lib/python3.12/site-packages/pandas/core/generic.py", line 1576, in __nonzero__
    raise ValueError(

(I truncated the file paths there - it did go all the way up to /)

I'm running on a macbook pro running Sonoma 14.4.1, using Safari 17.4.1, and python 3.12.2.

@crazyideas21
Copy link
Contributor

Thanks for reporting! I've occasionally seen this error, although I've not been able to reproduce it consistently. Investigating now.

@crazyideas21 crazyideas21 self-assigned this Apr 10, 2024
@crazyideas21 crazyideas21 added the bug Something isn't working label Apr 10, 2024
@crazyideas21
Copy link
Contributor

In fact, we're rewriting some of the backend code. Many users have found the current version to be slow.

@andytinkham
Copy link
Author

Are there files I can send or things I can try to help debug (or is your backend being rewritten comment mean that this will just stay until that rewrite is complete?)? The Overview page consistently shows this error for me. I can try stopping Inspector and restarting it (but I'd really prefer not to have to re-label all my devices, so hopefully those names all persist!)

@andytinkham
Copy link
Author

RIght after posting the above, I quit Inspector and relaunched it. Thankfully, the names persisted (!!) . Now when I load the Overview page, I get 1 graph (What are all the devices doing over time?) and then the error as above. Skimming looks like the same error, though I didn't match the whole stack trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants