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

Issue selecting Parameter in Story Point #47

Open
markbaird opened this issue Dec 8, 2021 · 1 comment
Open

Issue selecting Parameter in Story Point #47

markbaird opened this issue Dec 8, 2021 · 1 comment

Comments

@markbaird
Copy link

I'm trying to scrape the data here. In the browser I scroll to the "Cases Demographics" item at the top, which appears to be a Story Point. After selecting that I then select the "Age" radio button. Finally I am able to click Download -> Crosstab -> Excel and get the data I need.

I'm trying to use your library to automate this process. I can see the "Cases Demographics" in the storypoints list that comes back, and I'm able to select that. After selecting the storypoint I can see the different parameters available. But as soon as I select the "Age" parameter (or any of the available parameters) I just get this error and no data:

tableauScraper - WARNING - no data dictionary present in response

Also after selecting the story point, if I call getWorksheetNames() on the storypoint I just get an empty list.

Here is my code:

from tableauscraper import TableauScraper as TS

url = "https://public.tableau.com/views/NCDHHS_COVID-19_DataDownload_Story_16220681778000/DataBehindtheDashboards"
ts = TS()
ts.loads(url)
workbook = ts.getWorkbook()

print(workbook.getStoryPoints())
sp = workbook.goToStoryPoint(storyPointId=6)

# show parameters values / column
parameters = workbook.getParameters()
print(parameters)
workbook = workbook.setParameter(inputName="Select Demographic", value="Age")
print(sp.getWorksheetNames())

for ws in workbook.worksheets:
    print(f"worksheet name : {ws.name}")
    print(ws.data)

And the output:

{'storyBoard': 'DataBehindtheDashboards', 'storyPoints': [[{'storyPointId': 1, 'storyPointCaption': 'Daily Cases and Deaths Metrics'}, {'storyPointId': 16, 'storyPointCaption': 'Daily Cases and Deaths Metrics by County \n'}, {'storyPointId': 2, 'storyPointCaption': 'Daily Testing Metrics'}, {'storyPointId': 15, 'storyPointCaption': 'Percent Positive by County'}, {'storyPointId': 17, 'storyPointCaption': 'County Cases and Deaths \n'}, {'storyPointId': 4, 'storyPointCaption': 'ZIP Code Cases and Deaths'}, {'storyPointId': 5, 'storyPointCaption': 'Demographics'}, {'storyPointId': 6, 'storyPointCaption': 'Cases Demographics'}, {'storyPointId': 7, 'storyPointCaption': 'Outbreaks and Clusters'}, {'storyPointId': 8, 'storyPointCaption': 'Personal Protective Equipment (PPE)'}, {'storyPointId': 9, 'storyPointCaption': 'Hospital Patient Data'}, {'storyPointId': 10, 'storyPointCaption': 'Hospital Beds and Ventilators'}, {'storyPointId': 11, 'storyPointCaption': 'Hospital Demographics'}, {'storyPointId': 12, 'storyPointCaption': 'Vaccinations - Doses by County '}, {'storyPointId': 13, 'storyPointCaption': 'People Vaccinated by County '}, {'storyPointId': 14, 'storyPointCaption': 'People Vaccinated Demographics'}, {'storyPointId': 18, 'storyPointCaption': 'Wastewater Monitoring'}]]}
2021-12-08 17:14:01,366 - tableauScraper - WARNING - no data dictionary present in response
[{'column': 'Select Demographic', 'values': ['Race', 'Ethnicity', 'Age', 'Gender', 'Birth through K-12'], 'parameterName': '[Parameters].[Parameter 2 1]'}]
2021-12-08 17:14:03,302 - tableauScraper - WARNING - no data dictionary present in response
[]

@markbaird markbaird changed the title Issue selecting Parameter and in Story Point Issue selecting Parameter in Story Point Dec 8, 2021
@paulobh
Copy link

paulobh commented Jul 21, 2022

This library is amazing!

Just a similar issue probably related with some updates on the source:
https://replit.com/@bertrandmartel/TableauONSDemandaMaxima

The other thing I was trying was to use the goToStoryPoint() with the setParameter() but the data was not updated, maybe on updateFullData()?

print(wb.getStoryPoints())
# print("go to specific storypoint")
sp = wb.goToStoryPoint(storyPointId=5)

sp = sp.setParameter("Escala de Tempo CE Comp 3", "Dia")

on the example above it was expected to set the period frequency to daily however it only shows the default value (monthly).

I'm still trying to understand what might be the issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants