8000 addressed feedback · LehmD/server-client-python@55ed0d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55ed0d1

Browse files
committed
addressed feedback
1 parent a64b9b4 commit 55ed0d1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

samples/update_workbook_data_acceleration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####
2-
# This script demonstrates how to update workbook data freshness policy using the Tableau
2+
# This script demonstrates how to update workbook data acceleration using the Tableau
33
# Server Client.
44
#
55
# To run the script, you must have installed Python 3.7 or later.

samples/update_workbook_data_freshness_policy.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,16 @@ def main():
5757
# it could mean the workbook selected does not have live connection, which means it doesn't have
5858
# data freshness policy. Change to another workbook with live datasource connection.
5959
sample_workbook_extended = server.workbooks.get_by_id(sample_workbook.id)
60-
print(
61-
"Workbook "
62-
+ sample_workbook.name
63-
+ " has data freshness policy option set to: "
64-
+ sample_workbook_extended.data_freshness_policy.option
65-
)
60+
try:
61+
print(
62+
"Workbook "
63+
+ sample_workbook.name
64+
+ " has data freshness policy option set to: "
65+
+ sample_workbook_extended.data_freshness_policy.option
66+
)
67+
except AttributeError as e:
68+
print("Workbook does not have data freshness policy, possibly due to the workbook selected "
69+
"does not have live connection. Change to another workbook using live datasource connection.")
6670

6771
# Update Workbook Data Freshness Policy to "AlwaysLive"
6872
sample_workbook.data_freshness_policy = TSC.DataFreshnessPolicyItem(

0 commit comments

Comments
 (0)
0