Skip to content

Commit

Permalink
[components] Rename get_params_schema_type
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenKephart committed Jan 16, 2025
1 parent 00bac33 commit f8913e4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def scaffold_component_command(
raise Exception(
f"Component type {component_type} does not have a scaffolder. Reason: {scaffolder.message}."
)
scaffold_params = TypeAdapter(scaffolder.get_params_schema_type()).validate_json(
json_params
)
scaffold_params = TypeAdapter(scaffolder.get_schema()).validate_json(json_params)
else:
scaffold_params = {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_metadata(cls) -> "ComponentTypeInternalMetadata":
)

component_params = cls.get_schema()
scaffold_params = scaffolder.get_params_schema_type()
scaffold_params = scaffolder.get_schema()
return {
"summary": clean_docstring.split("\n\n")[0] if clean_docstring else None,
"description": clean_docstring if clean_docstring else None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ComponentScaffoldRequest:

class ComponentScaffolder:
@classmethod
def get_params_schema_type(cls) -> Optional[type[BaseModel]]:
def get_schema(cls) -> Optional[type[BaseModel]]:
return None

@abstractmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DbtScaffoldParams(BaseModel):

class DbtProjectComponentScaffolder(ComponentScaffolder):
@classmethod
def get_params_schema_type(cls) -> Optional[type[BaseModel]]:
def get_schema(cls) -> Optional[type[BaseModel]]:
return DbtScaffoldParams

def scaffold(self, request: ComponentScaffoldRequest, params: DbtScaffoldParams) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DefinitionsScaffoldParams(BaseModel):

class DefinitionsComponentScaffolder(ComponentScaffolder):
@classmethod
def get_params_schema_type(cls):
def get_schema(cls):
return DefinitionsScaffoldParams

def scaffold(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SimplePipesScriptAssetParams(BaseModel):

class SimplePipesScriptAssetScaffolder(ComponentScaffolder):
@classmethod
def get_params_schema_type(cls):
def get_schema(cls):
return SimplePipesScriptAssetParams

def scaffold(
Expand Down

0 comments on commit f8913e4

Please sign in to comment.