How to make a configuration on the base of a scheme from the previous node?

I have a question about python extensions.
The problem is, I have a node, that accepts a table on input. I want to make a configuration dialog, that allows a user to choose a column from the previous node table.
Following the manual, one needs to add a parameter after a class declaration:

class UniVieKnimeNode(knext.PythonNode):
smiles_column = knext.ColumnParameter(label=“SMILES column”,description=“The SMILES column to use”, port_index=0,include_none_column=False )

But the problem is that we have an input schema only inside configure function. If I try to do it inside configure I have an exception:

def configure(self, configure_context, input_schema):
LOGGER.info(“Configuring node”)
LOGGER.info(“Configure context: %s”, configure_context.flow_variables)
self.testing = knext.BoolParameter(“Enable Testing mode”, “All intermediate steps will be returned as ROMol”, False)

py4j.Py4JException: An exception was raised by the Python Proxy. Return Message: Traceback (most recent call last):
File “/home/sergeyadmin/miniconda3/envs/univiestand_env_internal/lib/python3.10/site-packages/py4j/clientserver.py”, line 617, in _call_proxy
return_value = getattr(self.pool[obj_id], method)(*params)
File “/home/sergeyadmin/distr/knime_4.6.1/plugins/org.knime.python3.nodes_4.6.2.v202209150850/src/main/python/knime_node_backend.py”, line 301, in getParameters
parameters_dict = kp.extract_parameters(self._node)
File “/home/sergeyadmin/distr/knime_4.6.1/plugins/org.knime.python3.nodes_4.6.2.v202209150850/src/main/python/knime_parameter.py”, line 77, in extract_parameters
return {“model”: _extract_parameters(obj, for_dialog)}
File “/home/sergeyadmin/distr/knime_4.6.1/plugins/org.knime.python3.nodes_4.6.2.v202209150850/src/main/python/knime_parameter.py”, line 84, in _extract_parameters
result[name] = param_obj._get_value(obj, for_dialog)
File “/home/sergeyadmin/distr/knime_4.6.1/plugins/org.knime.python3.nodes_4.6.2.v202209150850/src/main/python/knime_parameter.py”, line 248, in _get_value
return getattr(obj, self._name)
AttributeError: ‘BoolParameter’ object has no attribute ‘_name’

Hi pirotex,

does the first example not work for you? Could you provide some details? It looks good to me. Why would you need the input schema?

Best regards
Steffen

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.