Skip to content
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

getTupleIds fail to run when presModel is None #48

Open
wasdee opened this issue Dec 21, 2021 · 0 comments
Open

getTupleIds fail to run when presModel is None #48

wasdee opened this issue Dec 21, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@wasdee
Copy link

wasdee commented Dec 21, 2021

error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_22296/2734251275.py in <module>
----> 1 province_ws.getTupleIds()

~\.virtualenvs\icu-ZFp6mLxe\lib\site-packages\tableauscraper\TableauWorksheet.py in getTupleIds(self)
    324             columnObj = [
    325                 t
--> 326                 for t in utils.getIndicesInfo(
    327                     presModel, self.name, noSelectFilter=True, noFieldCaption=True
    328                 )

~\.virtualenvs\icu-ZFp6mLxe\lib\site-packages\tableauscraper\utils.py in getIndicesInfo(presModelMap, worksheet, noSelectFilter, noFieldCaption)
    126 
    127 def getIndicesInfo(presModelMap, worksheet, noSelectFilter=True, noFieldCaption=False):
--> 128     genVizDataPresModel = presModelMap["vizData"][
    129         "presModelHolder"
    130     ]["genPresModelMapPresModel"]["presModelMap"][worksheet]["presModelHolder"][

TypeError: 'NoneType' object is not subscriptable

reproduce

from tableauscraper import TableauScraper as TS

url= "https://public.tableau.com/views/moph_covid_v3/Story1"
ts = TS()
ts.loads(url)
workbook = ts.getWorkbook()

province_ws = workbook.getWorksheet("province_total")
province_ws.getTupleIds()

for more, pls look at https://github.com/CircleOnCircles/tableau-scraping/tree/fail-getTupleIds

pipenv install
pipenv run python issue.py

notes

  1. the column Prov Name has duplicate values. and in Thai alphabet
  2. worksheet.select() API fails consequently e.g. province_ws.select("Prov Name", "สมุทรสาคร")
@wasdee wasdee changed the title getTupleIds fail to handle when presModel is None getTupleIds fail to run when presModel is None Dec 21, 2021
@bertrandmartel bertrandmartel added the bug Something isn't working label Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants