diff --git a/pyiceberg/view/metadata.py b/pyiceberg/view/metadata.py index 33766040e3..d28ee41626 100644 --- a/pyiceberg/view/metadata.py +++ b/pyiceberg/view/metadata.py @@ -30,7 +30,7 @@ class SQLViewRepresentation(IcebergBaseModel): """Represents the SQL query that defines the view.""" - type: Literal["sql"] = Field() + type: Literal["sql"] = Field(default="sql") """A string that indicates the type of representation. Must be `sql`""" sql: str = Field() """A string that contains the SQL text of the view definition.""" diff --git a/tests/integration/test_rest_catalog.py b/tests/integration/test_rest_catalog.py index 05039a982e..be30709ba1 100644 --- a/tests/integration/test_rest_catalog.py +++ b/tests/integration/test_rest_catalog.py @@ -83,7 +83,6 @@ def test_load_view(catalog: RestCatalog, table_schema_nested: Schema, database_n summary={}, representations=[ SQLViewRepresentation( - type="sql", sql="SELECT 1 as some_col", dialect="spark", ) diff --git a/tests/integration/test_writes/test_writes.py b/tests/integration/test_writes/test_writes.py index 2a0c50a921..10d4a764d6 100644 --- a/tests/integration/test_writes/test_writes.py +++ b/tests/integration/test_writes/test_writes.py @@ -1772,7 +1772,6 @@ def test_create_view( schema_id=1, representations=[ SQLViewRepresentation( - type="sql", sql="SELECT 1 as some_col", dialect="spark", )