charles-001 / dolphie

Your single pane of glass for real-time analytics into MySQL/MariaDB & ProxySQL
https://pypi.org/project/dolphie/
GNU General Public License v3.0
589 stars 36 forks source link

TypeError: 'type' object is not subscriptable #54

Closed aadant closed 6 months ago

aadant commented 6 months ago
$ python --version
Python 3.8.18

$ dolphie
Traceback (most recent call last):
  File "/home/aadant/gitLocal/jump-splunk-ansible/.venv/bin/dolphie", line 5, in <module>
    from dolphie.app import main
  File "/home/aadant/gitLocal/jump-splunk-ansible/.venv/lib/python3.8/site-packages/dolphie/app.py", line 27, in <module>
    from dolphie.Modules.TabManager import Tab, TabManager
  File "/home/aadant/gitLocal/jump-splunk-ansible/.venv/lib/python3.8/site-packages/dolphie/Modules/TabManager.py", line 105, in <module>
    class TabManager:
  File "/home/aadant/gitLocal/jump-splunk-ansible/.venv/lib/python3.8/site-packages/dolphie/Modules/TabManager.py", line 460, in TabManager
    def get_all_tabs(self) -> list[Tab]:
TypeError: 'type' object is not subscriptable

$ pip list | grep dolphie
dolphie                   4.3.1
charles-001 commented 6 months ago

Hi @aadant - thanks for letting me know about this along with my apologies for that error. You're seeing that because Python 3.8 doesn't support subscript notation in type hint annotations. Instead, I need to use List from typing module. I will be pushing this fix in v4.3.2 here shortly.

charles-001 commented 6 months ago

v4.3.2 is now deployed with this fix

aadant commented 6 months ago

ok confirmed that it works after the upgrade