There are actually two fields in Atlan that capture the description of an asset: description and userDescription.
In the UI, userDescription will take precedence. This is the field that is updated when a user updates the description through the UI.
When a system updates a description, it will populate the description field. This field is only shown in the UI when the userDescription field is empty.
The examples below therefore all update the description field, to allow a user to still override this value through the UI. If you want to actually override any users' descriptions, however, replace description in the examples below with userDescription.
Use the removeDescription() helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary API(s), and return with the result of the removal operation all-in-one.
Use the updater() method to create an asset suitable for modification i.e. with all the requisite attributes.
Set the description to None.
Send the update to Atlan.
The response should only include that single asset that was updated (again, removing owners is an update to the asset — we are not deleting the asset itself).
Use the removeDescription() helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary API(s), and return with the result of the removal operation all-in-one.
models:-name:TOP_BEVERAGE_USERS# (1)description:>-# (2)My description of the asset
You must of course give the name of the object.
You just use the normal dbt description field to provide a description — no need for the meta.atlan.attributes structure.
Add description when creating asset
1234567
Tabletable=Table.creator("TOP_BEVERAGE_USERS",// (1)"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV").description("My description of the asset")// (2).build();// (3)AssetMutationResponseresponse=table.save();// (4)assertresponse.getCreatedAssets().size()==1// (5)
Use the creator() method to initialize the object with all necessary attributes for creating it (../advanced-examples/create.md#build-minimal-object-needed).
Set the description that should be added.
Call the build() method to build the enriched object.
Call the save() method to actually create the asset with this description.
The response will include that single asset that was created.
Add description when creating asset
1 2 3 4 5 6 7 8 9101112
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportTableclient=AtlanClient()table=Table.creator(# (1)name="TOP_BEVERAGE_USERS",schema_qualified_name="default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV",)table.description="My description of the asset"# (2)response=client.asset.save(table)# (3)assert1==len(assets_created:=response.assets_created(asset_type=Table))# (4)table=assets_created[0]# (5)
Use the creator() method to initialize the object with all necessary attributes for creating it.
Set the description.
Call the save() method to actually create the asset with these owners.
Since a save can add, update, delete or partially update multiple assets the assets_created() method can be used to return a list of the assets of the specified type that were added. The assert statement is present to ensure a Table asset was created.
Since only one Table has been created we use an index of 0 to retrieve the newly created table.
Add description when creating asset
1234567
valtable=Table.creator("TOP_BEVERAGE_USERS",// (1)"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV").description("My description of the asset")// (2).build()// (3)valresponse=table.save()// (4)assert(response.createdAssets.size==1)// (5)
Use the creator() method to initialize the object with all necessary attributes for creating it (../advanced-examples/create.md#build-minimal-object-needed).
Set the description that should be added.
Call the build() method to build the enriched object.
Call the save() method to actually create the asset with this description.
The response will include that single asset that was created.
POST /api/meta/entity/bulk
1 2 3 4 5 6 7 8 9101112131415161718
{"entities":[// (1){"typeName":"Table",// (2)"attributes":{"name":"TOP_BEVERAGE_USERS",// (3)"qualifiedName":"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV/TOP_BEVERAGE_USERS",// (4)"atlanSchema":{// (5)"typeName":"Schema","uniqueAttributes":{"qualifiedName":"default/snowflake/1657037873/SAMPLE_DB/FOOD_BEV"}},"description":"My description of the asset"// (6)}}]}
All assets must be wrapped in an entities array.
You must provide the exact type name for the asset (case-sensitive).
You must provide a name for the asset.
In the case of a table, the qualifiedName must be the concatenation of the parent schema's qualifiedName and the name of the table.
When creating a table, you must specify the schema to create it within. This is defined by the atlanSchema attribute. You must specify both the type (must be Schema) and qualifiedName of the schema within the atlanSchema attribute — and the schema must already exist.