Skip to content

[Feature Request]: Improve Type Hinting of fuctions passed to beam.Map() #29722

@jrmccluskey

Description

@jrmccluskey

What would you like to happen?

When a function used in beam.Map() has args default to None, the type hint would complain very confusing errors of "TypeError: issubclass() arg 1 must be a class". See code below:

def fn(v, arg=None):
  pass

# Without specifying `arg=None`, the type error shows up.
pc | 'map' >> beam.Map(fn, arg=None)

This should be improved to handle the None default arg.

Issue Priority

Priority: 3 (nice-to-have improvement)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions