Changing Tier does not replace the previously selected Tier
Patch API : api/v1/tables/
Payload:
[{"op":"replace","path":"/tags/0/tagFQN","value":"Tier.Tier3"}]
Response:
{
"id": "338fe5bb-b125-4ba6-aa61-313b29e9947d",
"name": "sql_sizing_profiles",
"href": "http://localhost:8585/api/v1/tables/338fe5bb-b125-4ba6-aa61-313b29e9947d",
"fullyQualifiedName": "aws_redshift.information_schema.sql_sizing_profiles",
<----------Other_fields------------->
"tags": [
{
"tagFQN": "Tier.Tier1",
"labelType": "Manual",
"state": "Confirmed"
},
{
"tagFQN": "Tier.Tier3",
"labelType": "Manual",
"state": "Confirmed"
}
]
}
Expected behaviour: Response should only have 1 Tier set, i.e. Tier3 in this case
@darth-coder00, are you creating a patch using JSON patch diff by diffing the original JSON and the updated JSON? I return the tags ordered by tag FQN name. When applying the patch, the server backend applies it to the table JSON in the same order. If you generated JSON patch with diffing two JSONs, then I recommend you use the right array index based on the JSON that you received from the server.
If you can repro this, can you also include the original table JSON you got?
Original JSON with tier as Tier1:
{
"id": "54a8f217-9674-453e-8639-fd2e31c70e9e",
"name": "category",
"href": "http://localhost:8585/api/v1/tables/54a8f217-9674-453e-8639-fd2e31c70e9e",
"fullyQualifiedName": "aws_redshift.public.category",
"columns": [
{
"name": "catid",
"columnDataType": "INT",
"fullyQualifiedName": "aws_redshift.public.category.catid",
"tags": [],
"columnConstraint": "NOT_NULL",
"ordinalPosition": 1
},
{
"name": "catgroup",
"columnDataType": "VARCHAR",
"fullyQualifiedName": "aws_redshift.public.category.catgroup",
"tags": [],
"columnConstraint": "NULL",
"ordinalPosition": 2
},
{
"name": "catname",
"columnDataType": "VARCHAR",
"fullyQualifiedName": "aws_redshift.public.category.catname",
"tags": [],
"columnConstraint": "NULL",
"ordinalPosition": 3
},
{
"name": "catdesc",
"columnDataType": "VARCHAR",
"fullyQualifiedName": "aws_redshift.public.category.catdesc",
"tags": [],
"columnConstraint": "NULL",
"ordinalPosition": 4
}
],
"usageSummary": {
"dailyStats": {
"count": 0,
"percentileRank": 0
},
"weeklyStats": {
"count": 0,
"percentileRank": 0
},
"monthlyStats": {
"count": 0,
"percentileRank": 0
},
"date": "2021-08-11"
},
"followers": [],
"database": {
"id": "654965e3-127a-475d-8ea1-783968da9c30",
"type": "database",
"name": "public",
"description": " ",
"href": "http://localhost:8585/api/v1/databases/654965e3-127a-475d-8ea1-783968da9c30"
},
"tags": [
{
"tagFQN": "Tier.Tier1",
"labelType": "Manual",
"state": "Confirmed"
}
],
"joins": {
"startDate": "2021-07-12",
"dayCount": 30,
"columnJoins": []
}
}
JSON patch:
[{"op":"replace","path":"/tags/0/tagFQN","value":"Tier.Tier3"}]
Response JSON:
{
"id": "54a8f217-9674-453e-8639-fd2e31c70e9e",
"name": "category",
"href": "http://localhost:8585/api/v1/tables/54a8f217-9674-453e-8639-fd2e31c70e9e",
"fullyQualifiedName": "aws_redshift.public.category",
"columns": [
{
"name": "catid",
"columnDataType": "INT",
"fullyQualifiedName": "aws_redshift.public.category.catid",
"tags": [],
"columnConstraint": "NOT_NULL",
"ordinalPosition": 1
},
{
"name": "catgroup",
"columnDataType": "VARCHAR",
"fullyQualifiedName": "aws_redshift.public.category.catgroup",
"tags": [],
"columnConstraint": "NULL",
"ordinalPosition": 2
},
{
"name": "catname",
"columnDataType": "VARCHAR",
"fullyQualifiedName": "aws_redshift.public.category.catname",
"tags": [],
"columnConstraint": "NULL",
"ordinalPosition": 3
},
{
"name": "catdesc",
"columnDataType": "VARCHAR",
"fullyQualifiedName": "aws_redshift.public.category.catdesc",
"tags": [],
"columnConstraint": "NULL",
"ordinalPosition": 4
}
],
"database": {
"id": "654965e3-127a-475d-8ea1-783968da9c30",
"type": "database",
"name": "public",
"description": " ",
"href": "http://localhost:8585/api/v1/databases/654965e3-127a-475d-8ea1-783968da9c30"
},
"tags": [
{
"tagFQN": "Tier.Tier1",
"labelType": "Manual",
"state": "Confirmed"
},
{
"tagFQN": "Tier.Tier3",
"labelType": "Manual",
"state": "Confirmed"
}
]
}