apache_beam.typehints.native_type_compatibility module

Module to convert Python’s native typing types to Beam types.

apache_beam.typehints.native_type_compatibility.convert_to_beam_type(typ)[source]

Convert a given typing type to a Beam type.

Parameters:typ (type) – typing type.
Returns:The given type converted to a Beam type as far as we can do the conversion.
Return type:type
Raises:ValueError – The type was malformed.
apache_beam.typehints.native_type_compatibility.convert_to_beam_types(args)[source]

Convert the given list or dictionary of args to Beam types.

Parameters:
  • args – Either an iterable of types, or a dictionary where the values are
  • types.
Returns:

If given an iterable, a list of converted types. If given a dictionary, a dictionary with the same keys, and values which have been converted.