Skip to content

Commit

Permalink
#1475 Add 'description' to datasource sample code (#1475)
Browse files Browse the repository at this point in the history
Update explore_datasource.py
  • Loading branch information
jacalata authored Sep 30, 2024
1 parent d480b75 commit e1b8281
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions samples/explore_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def main():
if args.publish:
if default_project is not None:
new_datasource = TSC.DatasourceItem(default_project.id)
new_datasource.description = "Published with a description"
new_datasource = server.datasources.publish(
new_datasource, args.publish, TSC.Server.PublishMode.Overwrite
)
Expand All @@ -72,6 +73,10 @@ def main():
print(f"\nConnections for {sample_datasource.name}: ")
print([f"{connection.id}({connection.datasource_name})" for connection in sample_datasource.connections])

# Demonstrate that description is editable
sample_datasource.description = "Description updated by TSC"
server.datasources.update(sample_datasource)

# Add some tags to the datasource
original_tag_set = set(sample_datasource.tags)
sample_datasource.tags.update("a", "b", "c", "d")
Expand Down

0 comments on commit e1b8281

Please sign in to comment.