Skip to content

Commit

Permalink
optionals
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-palakurthi committed Jun 19, 2024
1 parent 98c0035 commit 930e908
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 179 deletions.
16 changes: 8 additions & 8 deletions integ-tests/python/baml_client/partial_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ class ClassOptionalOutput2(BaseModel):

prop1: Optional[str] = None
prop2: Optional[str] = None
prop3: "Blah"
prop3: Optional["Blah"] = None

class ClassWithImage(BaseModel):


myImage: Optional[baml_py.Image] = None
param2: Optional[str] = None
fake_image: "FakeImage"
fake_image: Optional["FakeImage"] = None

class DynamicClassOne(BaseModel):

Expand All @@ -63,7 +63,7 @@ class DynamicClassTwo(BaseModel):
model_config = ConfigDict(extra='allow')

hi: Optional[str] = None
some_class: "SomeClassNestedDynamic"
some_class: Optional["SomeClassNestedDynamic"] = None
status: Optional[Union[types.DynEnumOne, str]] = None

class DynamicOutput(BaseModel):
Expand Down Expand Up @@ -105,7 +105,7 @@ class InnerClass(BaseModel):

prop1: Optional[str] = None
prop2: Optional[str] = None
inner: "InnerClass2"
inner: Optional["InnerClass2"] = None

class InnerClass2(BaseModel):

Expand All @@ -129,7 +129,7 @@ class OptionalTest_Prop1(BaseModel):
class OptionalTest_ReturnType(BaseModel):


omega_1: "OptionalTest_Prop1"
omega_1: Optional["OptionalTest_Prop1"] = None
omega_2: Optional[str] = None
omega_3: List[Optional[types.OptionalTest_CategoryType]]

Expand Down Expand Up @@ -168,8 +168,8 @@ class SearchParams(BaseModel):

dateRange: Optional[int] = None
location: List[Optional[str]]
jobTitle: "WithReasoning"
company: "WithReasoning"
jobTitle: Optional["WithReasoning"] = None
company: Optional["WithReasoning"] = None
description: List["WithReasoning"]
tags: List[Optional[Union[Optional[types.Tag], Optional[str]]]]

Expand All @@ -192,7 +192,7 @@ class TestClassNested(BaseModel):


prop1: Optional[str] = None
prop2: "InnerClass"
prop2: Optional["InnerClass"] = None

class TestClassWithEnum(BaseModel):

Expand Down
Loading

0 comments on commit 930e908

Please sign in to comment.