apache / apache/beam

Figure out how type hints should work

Open
#21,441 1 comment 0 reactions 0 assignees View on GitHub
core ml P2 python run-inference sub-task
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

RunInference main interface could have many different types of input and ouput types.

 

It probably should have generice typehints of some sort, but the code that infers them will need to be specified.

 

I haven't yet figured out how to do this, but I'm convinced that getting really specific type hints will help our users find errors.

 

We have

@input output types unknown

RunInference(PTransform)
  has RunInferenceDoFun (also input output types unknown)
    calls composedRunInferenceFn (input/output types known)

we need to get correct type hints into the RunInference PTransform and it's not apparent how to do that exactly since annotations won't be possible.

 

I think we'll need some correct values to put into the with_output_type chain in the ptransform.

Imported from Jira [BEAM-14217](https://issues.apache.org/jira/browse/BEAM-14217). Original Jira may contain additional context.
Reported by: Ryan.Thompson.
Subtask of issue #21435

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.