apache_beam.typehints.schemas module
Support for mapping python types to proto Schemas and back again.
Python Schema
np.int8 <—–> BYTE
np.int16 <—–> INT16
np.int32 <—–> INT32
np.int64 <—–> INT64
int —/
np.float32 <—–> FLOAT
np.float64 <—–> DOUBLE
float —/
bool <—–> BOOLEAN
The mappings for STRING and BYTES are different between python 2 and python 3,
because of the changes to str:
py3:
str/unicode <—–> STRING
bytes <—–> BYTES
ByteString —/
py2:
str will be rejected since it is ambiguous.
unicode <—–> STRING
ByteString <—–> BYTES
-
class
apache_beam.typehints.schemas.SchemaTypeRegistry[source]
Bases: object
-
add(typing, schema)[source]
-
get_typing_by_id(unique_id)[source]
-
get_schema_by_id(unique_id)[source]
-
apache_beam.typehints.schemas.named_fields_to_schema(names_and_types)[source]
-
apache_beam.typehints.schemas.typing_to_runner_api(type_)[source]
-
apache_beam.typehints.schemas.typing_from_runner_api(fieldtype_proto)[source]
-
apache_beam.typehints.schemas.named_tuple_from_schema(schema)[source]
-
apache_beam.typehints.schemas.named_tuple_to_schema(named_tuple)[source]