Skip to content

Changing Tier does not replace the previously selected Tier #92

Closed

Description

@darth-coder00

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

Activity

  1. added this to the milestone on Aug 10, 2021
  2. sureshms commented on Aug 10, 2021

    @sureshms
    Contributor

    @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?

  3. darth-coder00 commented on Aug 11, 2021

    @darth-coder00
    ContributorAuthor

    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": []
      }
    }
  4. darth-coder00 commented on Aug 11, 2021

    @darth-coder00
    ContributorAuthor

    JSON patch:

    [{"op":"replace","path":"/tags/0/tagFQN","value":"Tier.Tier3"}]
  5. darth-coder00 commented on Aug 11, 2021

    @darth-coder00
    ContributorAuthor

    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"
        }
      ]
    }
  6. added a commit that references this issue on May 9, 2022
  7. added a commit that references this issue on Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions