예제 #1
0
 def test_standard_handling(self):
     assert get_input_schema(standard_py_func) == self.standard_sample_input_schema
     assert get_output_schema(standard_py_func) == self.standard_sample_output_schema
예제 #2
0
 def test_spark_handling(self):
     assert get_input_schema(spark_func) == self.spark_sample_input_schema
     assert get_output_schema(spark_func) == self.spark_sample_output_schema
예제 #3
0
 def test_pandas_handling(self):
     assert get_input_schema(pandas_func) == self.pandas_sample_input_schema
     assert get_output_schema(pandas_func) == self.pandas_sample_output_schema
예제 #4
0
 def test_numpy_handling(self):
     assert get_input_schema(numpy_func) == self.numpy_sample_input_schema
     assert get_output_schema(numpy_func) == self.numpy_sample_output_schema
 def test_nested_handling(self):
     assert ordered(get_input_schema(nested_func)) == ordered(
         self.nested_sample_input_schema)
     assert ordered(get_output_schema(nested_func)) == ordered(
         self.nested_sample_output_schema)
예제 #6
0
from inference_schema.schema_decorators import input_schema, output_schema
from inference_schema.parameter_types.standard_py_parameter_type import StandardPythonParameterType


# %%
def init():
    print("This is init")


# %%
@input_schema('data', StandardPythonParameterType('input data'))
@output_schema(StandardPythonParameterType('test is inputdata'))
def run(data):
    test = json.loads(data)
    print(f"received data {test}")
    return f"test is {test}"


# %%
from inference_schema import schema_util

# %%
schema_util.get_input_schema(run)
# %%
schema_util.get_output_schema(run)
# %%
schema_util.get_schemas_dict()
# %%
schema_util.is_schema_decorated(run)
# %%