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

KeyError: 'zones' returned by getWorkbook() #23

Closed
Rhiyo opened this issue Jul 9, 2021 · 2 comments
Closed

KeyError: 'zones' returned by getWorkbook() #23

Rhiyo opened this issue Jul 9, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Rhiyo
Copy link

Rhiyo commented Jul 9, 2021

This is occurring with: https://public.tableau.com/views/StatebasedbuildingapprovalsABSNatHERS/NatHERSCertificatesvs_ABSBuildingApprovals

I attempted to see if I could fix the issue by checking to see if zones existed and return an empty string where zones is looked for. I imagine this causes other issues though as there was the only data I could find afterwards was returned by getSheets().

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)

/tmp/ipykernel_78053/2712717284.py in describe_tableau(ts, lines, url)
     10     workbook = ""
     11 
---> 12     workbook = ts.getWorkbook()
     13 
     14 

~/.local/lib/python3.9/site-packages/tableauscraper/TableauScraper.py in getWorkbook(self)
     98 
     99     def getWorkbook(self) -> TableauWorkbook:
--> 100         return dashboard.getWorksheets(self, self.data, self.info)
    101 
    102     def getWorksheet(self, worksheetName) -> TableauWorksheet:

~/.local/lib/python3.9/site-packages/tableauscraper/dashboard.py in getWorksheets(TS, data, info)
     53         worksheets = utils.listWorksheet(presModelMapVizData)
     54     elif presModelMapVizInfo is not None:
---> 55         worksheets = utils.listWorksheetInfo(presModelMapVizInfo)
     56         if len(worksheets) == 0:
     57             worksheets = utils.listStoryPointsInfo(presModelMapVizInfo)

~/.local/lib/python3.9/site-packages/tableauscraper/utils.py in listWorksheetInfo(presModel)
     42 
     43 def listWorksheetInfo(presModel):
---> 44     zones = presModel["workbookPresModel"]["dashboardPresModel"]["zones"]
     45     return [
     46         zones[z]["worksheet"]

KeyError: 'zones'
@bertrandmartel
Copy link
Owner

@Rhiyo Thanks, that's interesting. It seems it needs the clientDimension parameter when initiating the session to return the zones. I will add this parameter by default but I will first test with some Tableau url to see if it doesn't break anything

@bertrandmartel bertrandmartel added the bug Something isn't working label Jul 9, 2021
@bertrandmartel
Copy link
Owner

@Rhiyo this is fixed in v0.1.17

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