question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jacalatacommented, Jun 7, 2022

Huh - I can definitely repro this. I’ll take a look, thanks very much for following up!

0reactions
jorwoodscommented, 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_CHECKING flag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pros and Cons of Type Hints - Real Python
In this video, I'll show you the pros and cons of type hints. What are some of the ways that ... First, type...
Read more >
PEP 484 – Type Hints - Python Enhancement Proposals
When a type hint contains names that have not been defined yet, that definition may be expressed as a string literal, to be...
Read more >
Python's “type hints” are a bit of a disappointment to me
I agree that complexity could be an issue with Python's typing, which has some flaws, although it's been improving. Type aliases are okay...
Read more >
Static Python type hints - advantages and drawbacks
These type hints have no effect at run-time. Python does not evaluate any type hints, and there is no negative performance impact.
Read more >
Type hints in Python programming - Sourcegraph Learn
In this tutorial, we'll go through a type hinting example with guidance on how to catch type hinting errors. Then, we'll demonstrate how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found