Skip to content

fix: Handle optional properties in load namespace properties response#3169

Open
geruh wants to merge 1 commit intoapache:mainfrom
geruh:proptional
Open

fix: Handle optional properties in load namespace properties response#3169
geruh wants to merge 1 commit intoapache:mainfrom
geruh:proptional

Conversation

@geruh
Copy link
Member

@geruh geruh commented Mar 19, 2026

Closes #3167

Rationale for this change

The rest spec model GetNamespaceResponse defines the properties field as optional, and nullable. Also, following the description if the rest catalog doesn't support ns properties they should return null.

Link: https://github.com/apache/iceberg/blob/0a73da119ff38ee3a98f248b42180caa51001cec/open-api/rest-catalog-open-api.yaml#L4146-L4163

    GetNamespaceResponse:
      type: object
      required:
        - namespace
      properties:
        namespace:
          $ref: '#/components/schemas/Namespace'
        properties:
          type: object
          description:
            Properties stored on the namespace, if supported by the server.
            If the server does not support namespace properties, it should return null for this field.
            If namespace properties are supported, but none are set, it should return an empty object.
          additionalProperties:
            type: string
          example: { "owner": "Ralph", 'transient_lastDdlTime': '1452120468' }
          default: { }
          nullable: true

Looks like the pydantic models raise a ValidationError in the optional/null cases as seen in the issue above. So this PR adds a fix to handle these cases.

Are these changes tested?

Yes, added tests and tested with s3tables api

Are there any user-facing changes?

Not really

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting pydantic validation error while calling 'load_namespace_properties' method

1 participant