Skip to content

Mevsimsel Analiz Sorunu #2

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

Open
AshNumpy opened this issue Jul 17, 2024 · 0 comments
Open

Mevsimsel Analiz Sorunu #2

AshNumpy opened this issue Jul 17, 2024 · 0 comments

Comments

@AshNumpy
Copy link

Hata Tanımı

Analiz Sayfası içerisinde bulunan selection box ile Mevsimsel Analiz seçildiğinde TypeError hatası oluşuyor.

Hata Çıktısını Görmek için Tıkla
TypeError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).
Traceback:
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
    exec(code, module.__dict__)
File "/mount/src/big-tech-financial-insights/dashboard/app.py", line 586, in <module>
    st.plotly_chart(fig_monthly_avg)
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/metrics_util.py", line 408, in wrapped_func
    result = non_optional_func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/elements/plotly_chart.py", line 494, in plotly_chart
    plotly_chart_proto.spec = plotly.io.to_json(figure, validate=False)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/plotly/io/_json.py", line 221, in to_json
    return to_json_plotly(fig_dict, pretty=pretty, engine=engine)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/plotly/io/_json.py", line 142, in to_json_plotly
    json.dumps(plotly_object, cls=PlotlyJSONEncoder, **opts), _swap_json
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
          ^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/_plotly_utils/utils.py", line 56, in encode
    encoded_o = super(PlotlyJSONEncoder, self).encode(o)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/_plotly_utils/utils.py", line 133, in default
    return _json.JSONEncoder.default(self, obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '

Hata Nasıl Yinelenebilir?

  1. Live - web application içerisindeki sayfalardan Analiz sayfasına ilerle.
  2. Sol taraftaki sidebar üzerinden herhangi bir farklı hisse seç.
  3. Yine aynı sidebar'ın alt taraflarında bulunan selectbox tipindeki Ek Analizler başlığı altında bulunan Analiz türü seçin kısmından Mevsimsel Analiz'i seç.
  4. Sağ taraftaki ana sayfayı en aşağı kaydır ve hata çıktısı ile karşılaşabilirsin.

Ekran Görüntüsü:

image

Çözüm Önerisi

fig_monthly_avg değişkeni JSON'a dönüştürülmeye çalışılırken TypeError veriyor ki dönüştürülmeye çalışılan formatın uyumlu olup olmadığı kontrol edilebilir.

Tags

encoder.py, TypeError, Plotly, JSON

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