Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Jan 9, 2025
1 parent 6b7e6be commit a4a521a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,14 @@ def load_params(self, params_schema: Type[T]) -> T:
source_position_tree = cast(
YamlComponentDecl, self.decl_node
).component_file_model.source_position_tree
source_position_tree_of_params = source_position_tree.children["params"]
with enrich_validation_errors_with_source_position(source_position_tree_of_params, []):

if source_position_tree:
source_position_tree_of_params = source_position_tree.children["params"]
with enrich_validation_errors_with_source_position(
source_position_tree_of_params, []
):
return TypeAdapter(params_schema).validate_python(preprocessed_params)
else:
return TypeAdapter(params_schema).validate_python(preprocessed_params)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
class ComponentFileModel(BaseModel):
type: str
params: Optional[Mapping[str, Any]] = None
_source_position_tree: SourcePositionTree
_source_position_tree: Optional[SourcePositionTree] = None

@property
def source_position_tree(self) -> SourcePositionTree:
def source_position_tree(self) -> Optional[SourcePositionTree]:
return self._source_position_tree

@staticmethod
Expand Down

0 comments on commit a4a521a

Please sign in to comment.