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

compilation fails with pandas >=2.0 #11

Open
a4rcvv opened this issue Mar 21, 2024 · 0 comments
Open

compilation fails with pandas >=2.0 #11

a4rcvv opened this issue Mar 21, 2024 · 0 comments

Comments

@a4rcvv
Copy link
Contributor

a4rcvv commented Mar 21, 2024

Describe the bug

Sometimes scmlv fails to compile when I use it with pandas>=2.0.

To Reproduce
Steps to reproduce the behavior:

  1. Prepare a log folder containing negotiations.csv with None in the agreement column (i.e. logs containing broken negotiations).
  2. Run scmlv show -f <log folder>
  3. Parse Error occurs, and the visualizer raises TypeError
# Error of compilation
No tournament found ... reading world info
        Parse Error logs
        Did not find agent_stats
        Did not find product_stats
        Did not find world_stats
        Did not find contracts
        Did not find contract_stats
        Did not find negotiations
        Did not find offers
        Did not find neg_stats
        Did not find breaches
# Error from the visualizer
Traceback (most recent call last):
  File "/Users/a4rcvv/Documents/projects/scml-repro/.venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/Users/a4rcvv/Documents/projects/scml-repro/.venv/lib/python3.11/site-packages/scml_vis/presenter.py", line 1548, in <module>
    main(folder)
  File "/Users/a4rcvv/Documents/projects/scml-repro/.venv/lib/python3.11/site-packages/scml_vis/presenter.py", line 193, in main
    products["product"].unique(),
    ~~~~~~~~^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Expected behavior

scmlv can compile log files successfully.

System (please complete the following information):

  • scml-vis version: 0.3.1
  • Python version: 3.11
  • OS: macOS 14.2

Additional context

One of the current workaround is to use pandas<2.0.0.

Pandas treats a string of "None" as NaN in default since 2.0.0(ref: pandas-dev/pandas#50286, https://pandas.pydata.org/docs/dev/whatsnew/v2.0.0.html).

But it seems that scmlv wants to treat "None" as "None" as a string at here. When I use pandas>=2.0, NaN may be provided to this function which causes an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant