From e1b828120bd7164b3f20be43123335a977293784 Mon Sep 17 00:00:00 2001 From: Jac Date: Mon, 30 Sep 2024 14:46:00 -0700 Subject: [PATCH] #1475 Add 'description' to datasource sample code (#1475) Update explore_datasource.py --- samples/explore_datasource.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/explore_datasource.py b/samples/explore_datasource.py index 877c5f08..c9f35d5b 100644 --- a/samples/explore_datasource.py +++ b/samples/explore_datasource.py @@ -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 ) @@ -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")