Skip to content

Commit 6d9589b

Browse files
committed
Add default value for SQLViewRepresentation type field
1 parent ec1413d commit 6d9589b

3 files changed

Lines changed: 1 addition & 3 deletions

File tree

pyiceberg/view/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
class SQLViewRepresentation(IcebergBaseModel):
3131
"""Represents the SQL query that defines the view."""
3232

33-
type: Literal["sql"] = Field()
33+
type: Literal["sql"] = Field(default="sql")
3434
"""A string that indicates the type of representation. Must be `sql`"""
3535
sql: str = Field()
3636
"""A string that contains the SQL text of the view definition."""

tests/integration/test_rest_catalog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def test_load_view(catalog: RestCatalog, table_schema_nested: Schema, database_n
8383
summary={},
8484
representations=[
8585
SQLViewRepresentation(
86-
type="sql",
8786
sql="SELECT 1 as some_col",
8887
dialect="spark",
8988
)

tests/integration/test_writes/test_writes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,6 @@ def test_create_view(
17721772
schema_id=1,
17731773
representations=[
17741774
SQLViewRepresentation(
1775-
type="sql",
17761775
sql="SELECT 1 as some_col",
17771776
dialect="spark",
17781777
)

0 commit comments

Comments
 (0)