Hidden property doesn't work as expected.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:

- Ngôn ngữ chính
- Python
- Star
- 363
- Fork
- 183
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tableau/document-api-python
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
tableau/document-api-python#270 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
tableau/document-api-python#260 ·
-
docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
tableau/document-api-python#258 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
tableau/document-api-python#251 · 2 bình luận ·
-
Alternative for Document Api Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
tableau/document-api-python#250 · 2 bình luận ·