Esempio n. 1
0
    def define_outputs(self) -> tp.Dict[str, trac.ModelOutputSchema]:

        preprocessed = trac.declare_output_table(
            trac.F("id", trac.BasicType.STRING, label="Customer account ID", business_key=True),
            trac.F("some_quantity_x", trac.BasicType.DECIMAL, label="Some quantity X", format_code="CCY:EUR"))

        return {"preprocessed_data": preprocessed}
Esempio n. 2
0
    def define_outputs(self) -> tp.Dict[str, _api.ModelOutputSchema]:

        profit_by_region = _api.declare_output_table(
            _api.F("region", _api.BasicType.STRING, label="Customer home region", categorical=True),
            _api.F("gross_profit", _api.BasicType.DECIMAL, label="Total gross profit", format_code="CCY:USD"))

        return {"profit_by_region": profit_by_region}
Esempio n. 3
0
    def define_outputs(self) -> tp.Dict[str, trac.ModelOutputSchema]:

        output1 = trac.declare_output_table(
            trac.F("field1", trac.BasicType.INTEGER,
                   "Something about this field"),
            trac.F("field2", trac.BasicType.FLOAT,
                   "Something about this other field"))

        return {"output1": output1}
Esempio n. 4
0
    def define_outputs(self) -> tp.Dict[str, api.ModelOutputSchema]:

        output_table_1 = api.declare_output_table(
            api.F("output_field_1",
                  api.STRING,
                  label="Output field 1",
                  business_key=True),
            api.F("output_field_2", api.DATE, label="Output field 2"),
            api.F("output_field_3", api.FLOAT, label="Output field 3"))

        return {"output_table_1": output_table_1}