Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL query for schema field tags returns null #3333

Closed
Sunspark opened this issue Oct 6, 2021 · 2 comments
Closed

GraphQL query for schema field tags returns null #3333

Sunspark opened this issue Oct 6, 2021 · 2 comments
Labels
bug Bug report

Comments

@Sunspark
Copy link

Sunspark commented Oct 6, 2021

Describe the bug
When using the GraphQL API, the 'tags' attribute of a schema field returns null when there are tags present. The deprecated 'globalTags' attribute works fine.

To Reproduce
Steps to reproduce the behavior:

  1. Given a locally hosted copy of datahub running on docker (default base installation).
  2. Given that there is a dataset ingested to datahub, with descriptions, tags, and glossary terms added to it's schema
  3. When a GraphQL query is executed, requesting the 'tags' attribute for the fields of the schema
query {
  dataset(urn:"urn:li:dataset:(urn:li:dataPlatform:mssql,Adatabase.Aschema.Atable,PROD)"){
    urn
    editableProperties{
      description
    }
    editableSchemaMetadata{
      editableSchemaFieldInfo{
        fieldPath
        description 
        tags{
          tags{
            tag{
              name
              urn
            }
          }
        }
        glossaryTerms{
          terms{
            term{
              name
              urn
            }
          }
        }
      }
    }
  }
}
  1. Then the 'tags' attribute should return the tags associated with the fields of the schema
{
  "data": {
    "dataset": {
      "urn": "urn:li:dataset:(urn:li:dataPlatform:mssql,Adatabase.Aschema.Atable,PROD)",
      "editableProperties": {
        "description": "This is a description of a table."
      },
      "editableSchemaMetadata": {
        "editableSchemaFieldInfo": [
          {
            "fieldPath": "Code",
            "description": "New description of the Code field",
            "tags": null,  # <--------------- ERROR HERE, THIS FIELD HAS TAGS -------------------
            "glossaryTerms": {
              "terms": [
                {
                  "term": {
                    "name": "Rain",
                    "urn": "urn:li:glossaryTerm:Test Dictionary.Rain"
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Expected behavior
The 'tags' attribute should return the tags associated with the fields of the schema.
This behaviour can be seen if the deprecated attribute 'globalTags' is used. Note that the documentation of 'globalTags' is directly referring the user to use 'tags'.

query {
  dataset(urn:"urn:li:dataset:(urn:li:dataPlatform:mssql,Adatabase.Aschema.Atable,PROD)"){
    urn
    editableProperties{
      description
    }
    editableSchemaMetadata{
      editableSchemaFieldInfo{
        fieldPath
        description 
        globalTags{ #< ---------------- USING DEPRECATED ATTRIBUTE -----
          tags{
            tag{
              name
              urn
            }
          }
        }
        glossaryTerms{
          terms{
            term{
              name
              urn
            }
          }
        }
      }
    }
  }
}
{
  "data": {
    "dataset": {
      "urn": "urn:li:dataset:(urn:li:dataPlatform:mssql,Adatabase.Aschema.Atable,PROD)",
      "editableProperties": {
        "description": "This is a description of a table."
      },
      "editableSchemaMetadata": {
        "editableSchemaFieldInfo": [
          {
            "fieldPath": "Code",
            "description": "New description of the Code field",
            "globalTags": { # < ---------------- USING DEPRECATED ATTRIBUTE, RETURNS RESULTS -----
              "tags": [
                {
                  "tag": {
                    "name": "RAINMAN Code",
                    "urn": "urn:li:tag:RAINMAN Code"
                  }
                }
              ]
            },
            "glossaryTerms": {
              "terms": [
                {
                  "term": {
                    "name": "Rain",
                    "urn": "urn:li:glossaryTerm:Test Dictionary.Rain"
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows 10, on Azure VM, running Datahub standard container in Docker.
  • Browser: Chrome (latest)
  • Version: Datahub latest, updated with standard Docker pull morning of 06 Oct 2021
@jjoyce0510
Copy link
Collaborator

@jjoyce0510
Copy link
Collaborator

@shirshanka We can close this ticket :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants