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

Hidden property doesn't work as expected. #244

Open
dev-mkc19 opened this issue Nov 12, 2022 · 0 comments
Open

Hidden property doesn't work as expected. #244

dev-mkc19 opened this issue Nov 12, 2022 · 0 comments

Comments

@dev-mkc19
Copy link
Contributor

Hi. Release 0.10 brought ability to get status of field, either it hidden or not. But in fact Tableau workbook doesn't contain xml attribute for every field, only for hidden. So after initialisation Workbook object if you check fields you will see two values False or None.

But code and docstring inside hidden method tells that as a user I should expect only True False values. Am I right that it's a bug and None values have to be handled?

Code to reproduce:

import tableaudocumentapi
wb = tableaudocumentapi.Workbook('CheckBook_2021.2_sql.twb')
import pandas as pd

fs = []
for s in wb.datasources:
    for k in s.fields:
        try:
            id = s.fields[k].id
        except:
            pass
        try:
            name = s.fields[k].name
        except:
            pass
        try:
            caption = s.fields[k].caption
        except:
            pass
        try:
            calculation = s.fields[k].calculation
        except:
            pass
        try:
            hidden = s.fields[k].hidden
        except:
            pass


        fs.append({'ds': s.caption,
                    'id': id,
                'name': name,
                'caption': caption,
                'calculation': calculation,
                'hidden': hidden
                    })
df = pd.DataFrame.from_records(fs)
df

Result:
image

CheckBook_2021.2_sql.twb.zip

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

1 participant