8000 #1475 Add 'description' to datasource sample code (#1475) · TrimPeachu/server-client-python@e1b8281 · GitHub
[go: up one dir, main page]

Skip to content

Commit e1b8281

Browse files
authored
tableau#1475 Add 'description' to datasource sample code (tableau#1475)
Update explore_datasource.py
1 parent d480b75 commit e1b8281

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

samples/explore_datasource.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def main():
5151
if args.publish:
5252
if default_project is not None:
5353
new_datasource = TSC.DatasourceItem(default_project.id)
54+
new_datasource.description = "Published with a description"
5455
new_datasource = server.datasources.publish(
5556
new_datasource, args.publish, TSC.Server.PublishMode.Overwrite
5657
)
@@ -72,6 +73,10 @@ def main():
7273
print(f"\nConnections for {sample_datasource.name}: ")
7374
print([f"{connection.id}({connection.datasource_name})" for connection in sample_datasource.connections])
7475

76+
# Demonstrate that description is editable
77+
sample_datasource.description = "Description updated by TSC"
78+
server.datasources.update(sample_datasource)
79+
7580
# Add some tags to the datasource
7681
original_tag_set = set(sample_datasource.tags)
7782
sample_datasource.tags.update("a", "b", "c", "d")

0 commit comments

Comments
 (0)
0