Error with pandas in the Labs Python Integration

Hi all,

I am trying to run a script using the Labs Python Integration node and I encounter an error that does not happen when I execute the code in pure Python.


# the column last is Local Date in KNIME
dfc[fd_revw] = 3
dfc['expected'] = dfc['last'] + pd.to_timedelta(dfc['estimate'] * 365, unit='D')

I get the following exception:

Executing the Python script failed: Traceback (most recent call last):
  File "<string>", line 18, in <module>
  File "C:\Users\md45qh\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\ops\", line 69, in new_method
    return method(self, other)
  File "C:\Users\md45qh\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\", line 92, in __add__
    return self._arith_method(other, operator.add)
  File "C:\Users\md45qh\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\", line 5526, in _arith_method
    result = ops.arithmetic_op(lvalues, rvalues, op)
  File "C:\Users\md45qh\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\ops\", line 218, in arithmetic_op
    res_values = op(left, right)
TypeError: unsupported operand type(s) for +: 'KnimePandasExensionArray' and 'TimedeltaArray'

Does anyone know what might be going on?

Another error, now when performing a Join using PyArrow, which also seems to be related to some KNIME specific data type.

This happens whenever I have a Local Date field in my data and I use this in the join by the way. When I remove these fields, the join run without problems. Looking at the data schema, it seems that Local Date fields get a this KNIME Logical Type as opposed to an actual data type (e.g. string):


@toscanomatheus could you give us an example where this happens that one might be able to reproduce? Is the error within the Python node or when trying to bring the data back to KNIME?