Skip to content

Commit 0f46420

Browse files
authored
fix(types): make sql optional (#4)
1 parent 7f31135 commit 0f46420

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/cube_http/types/v1/meta.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ class V1CubeMetaJoin(BaseModel):
2323
description="The type of relationship between the cubes. Valid relationships are `one_to_one`, `one_to_many`, and `many_to_one`."
2424
)
2525

26-
sql: str = Field(
27-
description="The SQL ON clause that specifies the join condition between the cubes. It is important to accurately define the matching columns to ensure correct join behavior."
26+
sql: Optional[str] = Field(
27+
default=None,
28+
description="The SQL ON clause that specifies the join condition between the cubes. It is important to accurately define the matching columns to ensure correct join behavior.",
2829
)
2930

3031

@@ -34,8 +35,8 @@ class V1CubeMetaSegment(BaseModel):
3435
description="The unique identifier for the segment. It must be unique among all segments, dimensions, and measures within a cube and follow naming conventions.",
3536
)
3637

37-
sql: str = Field(
38-
default="",
38+
sql: Optional[str] = Field(
39+
default=None,
3940
description="A required parameter that defines the SQL expression used to filter the data for this segment. The SQL should be valid within a WHERE clause and can implement complex filtering logic.",
4041
)
4142

@@ -80,8 +81,8 @@ class V1CubeMetaDimension(BaseModel):
8081
description="A description providing more context about what the dimension represents. This is useful for ensuring that users understand the attribute correctly.",
8182
)
8283

83-
sql: str = Field(
84-
default="",
84+
sql: Optional[str] = Field(
85+
default=None,
8586
description="A required parameter that defines the SQL expression used to derive the dimension's value. The SQL should return a value consistent with the dimension's type.",
8687
)
8788

@@ -149,8 +150,8 @@ class V1CubeMetaMeasure(BaseModel):
149150
description="A description providing more context about what the measure represents. This is useful for ensuring that users understand the metric correctly.",
150151
)
151152

152-
sql: str = Field(
153-
default="",
153+
sql: Optional[str] = Field(
154+
default=None,
154155
description="A required parameter that defines the SQL expression used to calculate the measure. Depending on the measure type, this can be an aggregation, a simple SQL expression, or even a calculation involving other measures.",
155156
)
156157

0 commit comments

Comments
 (0)