Originally posted by **avitalanki** November 8, 2024
I just installed streamlit-analytics2 and configured my app but get following error on the analytics page. Please advise
TypeError: Object of type int64 is not JSON serializable
Traceback:
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/site-packages/streamlit/runtime/fragment.py", line 248, in wrapped_fragment
result = non_optional_func(*args, **kwargs)
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/site-packages/streamlit/elements/dialog_decorator.py", line 99, in dialog_content
_ = non_optional_func(*args, **kwargs)
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/site-packages/streamlit_analytics2/display.py", line 96, in show_results
st.altair_chart(layer, use_container_width=True)
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/site-packages/streamlit/runtime/metrics_util.py", line 410, in wrapped_func
result = non_optional_func(*args, **kwargs)
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/site-packages/streamlit/elements/vega_charts.py", line 1599, in altair_chart
return self._altair_chart(
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/site-packages/streamlit/elements/vega_charts.py", line 1804, in _altair_chart
return self._vega_lite_chart(
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/site-packages/streamlit/elements/vega_charts.py", line 1873, in _vega_lite_chart
vega_lite_proto.spec = _stabilize_vega_json_spec(json.dumps(spec))
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/dsw/snapshots/1b75112a-85fa-4b13-9c56-5822402b8861/python39/lib/python3.9/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
Discussed in https://github.com/444B/streamlit-analytics2/discussions/117