apache_beam.yaml.json_utils module¶
Utilities for converting between JSON and Beam Schema’d data.
For internal use, no backward compatibility guarantees.
- apache_beam.yaml.json_utils.json_schema_to_beam_schema(json_schema: Dict[str, Any]) Schema [source]¶
Returns a Beam schema equivalent for the given Json schema.
- apache_beam.yaml.json_utils.json_type_to_beam_type(json_type: Dict[str, Any]) FieldType [source]¶
Returns a Beam schema type for the given Json (schema) type.
- apache_beam.yaml.json_utils.json_to_row(beam_type: FieldType) Callable[[Any], Any] [source]¶
Returns a callable converting Json objects to Beam rows of the given type.
The input to the returned callable is expected to conform to the Json schema corresponding to this Beam type.
- apache_beam.yaml.json_utils.json_parser(beam_schema: Schema, json_schema: Dict[str, Any] | None = None) Callable[[bytes], Row] [source]¶
Returns a callable converting Json strings to Beam rows of the given type.
The input to the returned callable is expected to conform to the Json schema corresponding to this Beam type.