1818
1919from typing import Dict , List , Literal , Optional , Union
2020
21- from pydantic import Field , field_validator
21+ from pydantic import Field , RootModel , field_validator
2222
2323from pyiceberg .schema import Schema
2424from pyiceberg .typedef import IcebergBaseModel , Identifier , Properties
@@ -36,8 +36,8 @@ class SQLViewRepresentation(IcebergBaseModel):
3636 """The dialect of the SQL, e.g. `spark`, `trino`, `presto`."""
3737
3838
39- class ViewRepresentation (IcebergBaseModel ):
40- __root__ : SQLViewRepresentation
39+ class ViewRepresentation (IcebergBaseModel , RootModel ):
40+ root : SQLViewRepresentation
4141
4242
4343class ViewVersion (IcebergBaseModel ):
@@ -55,7 +55,7 @@ class ViewVersion(IcebergBaseModel):
5555 """A list of representations for the view definition"""
5656 default_catalog : Optional [str ] = Field (alias = "default-catalog" , default = None )
5757 """Catalog name to use when a reference in the SELECT does not contain a catalog"""
58- default_namespace : Union [ str , Identifier ] = Field (alias = "default-namespace" )
58+ default_namespace : Identifier = Field (alias = "default-namespace" )
5959 """Namespace to use when a reference in the SELECT is a single identifier"""
6060
6161
0 commit comments