Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Kinard <[email protected]>
  • Loading branch information
Polber committed Dec 23, 2024
1 parent 063890c commit bf92cd8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sdks/python/apache_beam/yaml/yaml_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __init__(
so that input data can be sent using an API request, and inferences can be
received as a response.
This Model Handler also required a `preprocess` function to be defined.
This Model Handler also requires a `preprocess` function to be defined.
Preprocessing and Postprocessing are described in more detail in the
RunInference docs:
https://beam.apache.org/releases/yamldoc/current/#runinference
Expand Down Expand Up @@ -434,14 +434,13 @@ def fn(x: PredictionResult):
if missing_params:
raise ValueError(f'Missing parameters in model_handler: {missing_params}')
typ = model_handler['type']
model_handler_provider = ModelHandlerProvider.handler_types.get(typ, None)
if model_handler_provider and issubclass(model_handler_provider,
type(ModelHandlerProvider)):
model_handler_provider.validate(model_handler['config'])
else:
model_handler_provider_type = ModelHandlerProvider.handler_types.get(
typ, None)
if not model_handler_provider_type:
raise NotImplementedError(f'Unknown model handler type: {typ}.')

model_handler_provider = ModelHandlerProvider.create_handler(model_handler)
model_handler_provider.validate(model_handler['config'])
user_type = RowTypeConstraint.from_user_type(pcoll.element_type.user_type)
schema = RowTypeConstraint.from_fields(
list(user_type._fields if user_type else []) +
Expand Down

0 comments on commit bf92cd8

Please sign in to comment.