def test_json_schema_to_pyarrow_schema(self, json_schema: Mapping[str, Any], pyarrow_schema: Mapping[str, Any]) -> None:
     # Json -> PyArrow direction
     if pyarrow_schema is not None:
         assert AbstractFileParser.json_schema_to_pyarrow_schema(json_schema) == pyarrow_schema
     else:
         with pytest.raises(Exception) as e_info:
             AbstractFileParser.json_schema_to_pyarrow_schema(json_schema)
             LOGGER.debug(str(e_info))
 def test_json_schema_to_pyarrow_schema_reverse(self, pyarrow_schema: Mapping[str, Any], json_schema: Mapping[str, Any]) -> None:
     # PyArrow -> Json direction (reverse=True)
     if json_schema is not None:
         assert AbstractFileParser.json_schema_to_pyarrow_schema(pyarrow_schema, reverse=True) == json_schema
     else:
         with pytest.raises(Exception) as e_info:
             AbstractFileParser.json_schema_to_pyarrow_schema(pyarrow_schema, reverse=True)
             LOGGER.debug(str(e_info))
Example #3
0
 def test_json_type_to_pyarrow_type(self, input_json_type,
                                    output_pyarrow_type):
     # Json -> PyArrow direction
     LOGGER.info(
         f"asserting that JSON type '{input_json_type}' converts to PyArrow type '{output_pyarrow_type}'..."
     )
     assert AbstractFileParser.json_type_to_pyarrow_type(
         input_json_type) == output_pyarrow_type
Example #4
0
 def test_json_type_to_pyarrow_type_reverse(self, input_pyarrow_types,
                                            output_json_type):
     # PyArrow -> Json direction (reverse=True)
     for typ in input_pyarrow_types:
         LOGGER.info(
             f"asserting that PyArrow type '{typ}' converts to JSON type '{output_json_type}'..."
         )
         assert AbstractFileParser.json_type_to_pyarrow_type(
             typ, reverse=True) == output_json_type