|
10 | 10 | icon_path="../icons/icon.png", |
11 | 11 | category="/", |
12 | 12 | ) |
13 | | -@knext.input_table(name="Input Data", description="We read data from here") |
| 13 | +# @knext.input_table(name="Input Data", description="We read data from here") |
14 | 14 | # @knext.input_table(name="Tutorial: Input Data 2", description="We also read data from here") ### Tutorial step 11: Uncomment to create a new input port |
15 | | -@knext.output_table(name="Output Data", description="Whatever the node has produced") |
| 15 | +# @knext.output_table(name="Output Data", description="Whatever the node has produced") |
16 | 16 | class TemplateNode: |
17 | 17 | """Short one-line description of the node. |
18 | 18 | Long description of the node. |
@@ -40,17 +40,27 @@ class TemplateNode: |
40 | 40 |
|
41 | 41 | # column_param = knext.ColumnParameter(label="label", description="description", port_index=0, column_filter=is_numeric) |
42 | 42 |
|
43 | | - def configure(self, configure_context, input_schema_1): |
| 43 | + date = knext.DateTimeParameter( |
| 44 | + label="Date Parameter", |
| 45 | + description="A date time parameter", |
| 46 | + default_value="2023-01-01", |
| 47 | + ) |
| 48 | + |
| 49 | + @date.validator |
| 50 | + def validate_date(value): |
| 51 | + logging.warning(f"Validating date: {value}, type: {type(value)}") |
| 52 | + |
| 53 | + def configure(self, configure_context): |
44 | 54 | # def configure(self, configure_context, input_schema_1, input_schema_2): ### Tutorial step 11: Uncomment to configure the new port (and comment out the previous configure header) |
45 | | - return input_schema_1 |
| 55 | + return [] |
46 | 56 | ### Tutorial step 12: Uncomment the following to adjust to the changes we do in this step in the execute method (and comment out the previous return statement) |
47 | 57 | # return input_schema_1.append(knext.Column(knext.double(), "column2")) |
48 | 58 | ### Tutorial step 13: Uncomment to set a warning for the configuration, which will be shown in the workflow |
49 | 59 | # configure_context.set_warning("This is a warning during configuration") |
50 | 60 |
|
51 | | - def execute(self, exec_context, input_1): |
| 61 | + def execute(self, exec_context): |
52 | 62 | # def execute(self, exec_context, input_1, input_2): ### Tutorial step 11: Uncomment to accept the new port (and comment out the previous execute header) |
53 | | - return input_1 |
| 63 | + return [] |
54 | 64 | ### Tutorial step 12: Uncomment the following lines to work with the new port (and comment out the previous return statement) |
55 | 65 | # input_1_pandas = input_1.to_pandas() # Transform the input table to some processable format (pandas or pyarrow) |
56 | 66 | # input_2_pandas = input_2.to_pandas() |
|
0 commit comments