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

Standardization does not preserve metadata of nested fields #56

Open
yruslan opened this issue Aug 15, 2024 · 0 comments
Open

Standardization does not preserve metadata of nested fields #56

yruslan opened this issue Aug 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yruslan
Copy link
Contributor

yruslan commented Aug 15, 2024

Describe the bug

Standardization keeps metadata of root fields, but does not preserve metadata of nested fields.

To Reproduce

Run standardization of a dataframe with a following schema:

{
  "type": "struct",
  "fields": [
    {
      "name": "STRING_FIELD",
      "type": "string",
      "nullable": true,
      "metadata": {
        "maxLength": 8
      }
    },
    {
      "name": "NESTED_STRUCT",
      "type": {
        "type": "struct",
        "fields": [
          {
            "name": "NESTED_STRING",
            "type": "string",
            "nullable": true,
            "metadata": {
              "maxLength": 5
            }
          }
        ]
      }
    }
  ]
}

The result will look like this (nested field's metadata is lost):

{
  "type": "struct",
  "fields": [
    {
      "name": "STRING_FIELD",
      "type": "string",
      "nullable": true,
      "metadata": {
        "maxLength": 8
      }
    },
    {
      "name": "NESTED_STRUCT",
      "type": {
        "type": "struct",
        "fields": [
          {
            "name": "NESTED_STRING",
            "type": "string",
            "nullable": true,
            "metadata": { }
          }
        ]
      }
    }
  ]
}
  • STRING_FIELD has metadata retained.
  • NESTED_STRING has list metadata field "maxLength": 5

Expected behavior

Standardization should preserve all metadata.

Screenshots

--

Desktop (please complete the following information):

--

Additional context

--

@yruslan yruslan added the bug Something isn't working label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant