'executescript problems when i will going to show this message

i use ExecuteScript for lunch this code

but this error appeared o.a.nifi.processors.script.ExecuteScript ExecuteScript[id=e0beca0c-0180-1000-7dbe-5ae9636e8ecf] Failed to process session due to org.apache.nifi.processor.exception.ProcessException: javax.script.ScriptException: NameError: name 'temperature' is not defined in at line number 1: org.apache.nifi.processor.exception.ProcessException: javax.script.ScriptException: NameError: name 'temperature' is not defined in at line number 1 org.apache.nifi.processor.exception.ProcessException: javax.script.ScriptException: NameError: name 'temperature' is not defined in at line number 1 at org.apache.nifi.processors.script.ExecuteScript.onTrigger(ExecuteScript.java:254) enter image description here



Solution 1:[1]

A set requires that all elements in it are hashable. A dictionary is not hashable.

An object is hashable if it has a hash value which never changes during its lifetime (it needs a hash() method), and can be compared to other objects (it needs an eq() method). Hashable objects which compare equal must have the same hash value.

Hashability makes an object usable as a dictionary key and a set member, because these data structures use the hash value internally.

Most of Python’s immutable built-in objects are hashable; mutable containers (such as lists or dictionaries) are not; immutable containers (such as tuples and frozensets) are only hashable if their elements are hashable. Objects which are instances of user-defined classes are hashable by default. They all compare unequal (except with themselves), and their hash value is derived from their id().

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lukas Nothhelfer