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
Run mypy test_script.py --ignore-missing-imports --strict
Results
mypy test_script.py --ignore-missing-imports --strict
test_script.py:8: error: Module has no attribute "TableauAuth"
test_script.py:9: error: Module has no attribute "Server"
test_script.py:10: error: Module has no attribute "GroupItem"
=> this is simplistic and mypy complains
I suspect the typed.py file is not at the right place or the imports are not being set correctly In the init.py file
The types are not present in 0.18. Try again with the development branch. It should work there. 0.19 is being prepared for release and will have the typing information.
mypy test_script.py --ignore-missing-imports --strict
test_script.py:8: error: Module has no attribute "TableauAuth"
test_script.py:9: error: Module has no attribute "Server"
test_script.py:10: error: Module has no attribute "GroupItem"
Found 3 errors in 1 file (checked 1 source file)
(venv) % python
Python 3.9.2 (v3.9.2:1a79785e3e, Feb 19 2021, 09:06:10)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tableauserverclient as TSC
>>> TSC.__version__
'0.19.0'
>>> exit()
I believe the problem is because if you are in the TYPE_CHECKING mode, there are circular references, which break when trying to inspect from the top level. These things still work during run time because they are behind the TYPE_CHECKING flag.
Activity
jorwoods commentedon Jun 6, 2022
The types are not present in 0.18. Try again with the development branch. It should work there. 0.19 is being prepared for release and will have the typing information.
jacalata commentedon Jun 7, 2022
Thanks jorwoods - @pierresouchay this release is now available and hopefully solves your issue!
pierresouchay commentedon Jun 7, 2022
@jorwoods @jacalata Does not seem to work...
With the example provided above:
jacalata commentedon Jun 7, 2022
Huh - I can definitely repro this. I'll take a look, thanks very much for following up!
jorwoods commentedon Jun 8, 2022
I believe the problem is because if you are in the TYPE_CHECKING mode, there are circular references, which break when trying to inspect from the top level. These things still work during run time because they are behind the
TYPE_CHECKINGflag.jorwoods commentedon Jun 20, 2024
Tested and confirmed this is resolved by #1394