Skip to content

Commit

Permalink
add arbitrary_types_allowed across the board
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed Feb 13, 2024
1 parent 9ac7284 commit 277ec70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hayhooks/server/utils/deploy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def deploy_pipeline_def(app, pipeline_def: PipelineDefinition):
component_model[name] = (typedef["type"], typedef.get("default_value", ...))
request_model[component_name] = (create_model('ComponentParams', **component_model, __config__=config), ...)

PipelineRunRequest = create_model(f'{pipeline_def.name.capitalize()}RunRequest', **request_model)
PipelineRunRequest = create_model(f'{pipeline_def.name.capitalize()}RunRequest', **request_model, __config__=config)

response_model = {}
for component_name, outputs in pipe.outputs().items():
Expand All @@ -48,7 +48,9 @@ def deploy_pipeline_def(app, pipeline_def: PipelineDefinition):
component_model[name] = (typedef["type"], ...)
response_model[component_name] = (create_model('ComponentParams', **component_model, __config__=config), ...)

PipelineRunResponse = create_model(f'{pipeline_def.name.capitalize()}RunResponse', **response_model)
PipelineRunResponse = create_model(
f'{pipeline_def.name.capitalize()}RunResponse', **response_model, __config__=config
)

# There's no way in FastAPI to define the type of the request body other than annotating
# the endpoint handler. We have to ignore the type here to make FastAPI happy while
Expand Down

0 comments on commit 277ec70

Please sign in to comment.