You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KeyError: 'message' occurs when trying to build a model with wrong datatype #379
When the data has wrong datatype (e.g. values of dataset are str type), pystan raises KeyError: 'message'.
The full Traceback is:
Traceback (most recent call last):
File "/workdir/main.py", line 25, in <module>
posterior = stan.build(model, data=data)
File "/usr/local/lib/python3.9/site-packages/stan/model.py", line 519, in buildreturn asyncio.run(go())
File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in runreturn loop.run_until_complete(main)
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_completereturn future.result()
File "/usr/local/lib/python3.9/site-packages/stan/model.py", line 511, in goraiseRuntimeError(resp.json()["message"])
KeyError: 'message'
This is possibly a problem of the httpstan.
But I think this pystan's behavior isn't intended. So I'm reporting here.
Describe your system
CPU type: x86-64
Windows 10 19044.2251
WSL 2 Ubuntu 20.04
Docker Desktop 4.10.1
Python 3.9 (I also checked occurrence of the same error in 3.8 and 3.11)
pystan 3.6.0 and httpstan 4.9.1 (I also checked in pystan==3.2.0 and httpstan==4.5.0)
Steps/Code to Reproduce
My code sample consists of two files. To run them, please place them at the same directory.
Activity
riddell-stan commentedon Dec 8, 2022
Good catch. This does look like a bug.