server-client-python icon indicating copy to clipboard operation
server-client-python copied to clipboard

Type hint issues

Open pierresouchay opened this issue 2 years ago • 6 comments

Describe the bug Recently tried to bump tableauserverclient from version 0.16.0 to 0.18.0

Versions Details of your environment, including:

  • Tableau Server version : Tableau Online
  • Python version: 3.9
  • TSC library version: 0.18.0
  • mypy version: mypy 0.942

To Reproduce Create this simplistic file:

#!/usr/bin/env/python

import os

import tableauserverclient as TSC


tableau_auth = TSC.TableauAuth(os.environ["USERNAME"], os.environ["PASSWORD"], site_id=os.environ["SITE_ID"])
server = TSC.Server("https://dub01.online.tableau.com")
my_group = TSC.GroupItem(os.environ["GROUP_ITEM"])

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

Maybe https://github.com/tableau/server-client-python/issues/991 not being implemented correctly

pierresouchay avatar May 31 '22 10:05 pierresouchay