Hidden property doesn't work as expected.

Aperta
#244 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Start with Workbook initialization and the field hidden method referenced in the issue, then run the provided reproduction against CheckBook_2021.2_sql.twb. Compare fields whose XML lacks the hidden attribute with the method's documented return values. Done means the behavior and docstring consistently communicate the intended True/False result, with coverage for fields without the attribute.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
363
Fork
183
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tableau/document-api-python

Tutte le issue di tableau/document-api-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.