Unverified Commit 07cdd442 authored by Allison Doami's avatar Allison Doami Committed by GitHub

Column badge documentation (#962)

Signed-off-by: 's avataradoami <adoami@chanzuckerberg.com>
parent 903aea3a
......@@ -55,7 +55,19 @@ To delete a badge on a table:
curl -X DELETE https://{your metadata url}/table/{table key}/badge/{badge name}?category={badge category}
```
To add a badge on a column:
```
curl -X PUT https://{your metadata url}/table/{table key}/column/{column name}/badge/{badge name}?category={badge category}
```
To delete a badge on a column:
```
curl -X DELETE https://{your metadata url}/table/{table key}/column/{column name}/badge/{badge name}?category={badge category}
```
`table key` is in the format of `datasource://database.schema/table`
## Adding badges throught databuilder (and column level badges)
To add badges using databuilder, you can use the [BadgeMetadata](https://github.com/amundsen-io/amundsendatabuilder/blob/master/databuilder/models/badge.py) class and pass in the entity you want to create a badge relationship for. For an example of how this is done search for badge in [TableMetadata](https://github.com/amundsen-io/amundsendatabuilder/blob/master/databuilder/models/table_metadata.py) to see how we add badge nodes and relationships to neo4j.
In [hive_table_metadata_extractor.py](https://github.com/amundsen-io/amundsendatabuilder/blob/8655338725bf279ea0332e5e6ab0592c8c7459ae/databuilder/extractor/hive_table_metadata_extractor.py#L106) you can see how the partition column is obtained and added to a column so the badge node can be created and related to the correct column.
\ No newline at end of file
In [hive_table_metadata_extractor.py](https://github.com/amundsen-io/amundsendatabuilder/blob/8655338725bf279ea0332e5e6ab0592c8c7459ae/databuilder/extractor/hive_table_metadata_extractor.py#L106) you can see how the partition column is obtained and added to a column so the badge node can be created and related to the correct column.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment