I'd like to code some stuff in the LAB-node "Python Script".
The input_table contains a date, represented as datatype "string". Converted with the "Column Rename" node from Date to string. The Output_Table of "Column Rename" is just fine... see for example:
2014-05-13
2014-05-13
2014-05-14
2014-05-14
2014-05-14
Python Scripting- node Code:
output_table = input_table.copy()
BUT: Running my Python Script node there are a lot of warnings displayed and the process takes REALLY LONG!
WARNINGS in Console (I know they could be hidden, but I wanna be aware of whats happening there)
WARN DateAndTimeCell Second is a time field, which is not supported by this instance!
WARN DateAndTimeCell Milliseconds are not supported by this instance!
WARN DateAndTimeCell Hour is a time field, which is not supported by this instance!
WARN DateAndTimeCell Minute is a time field, which is not supported by this instance!
There is also a problem printing the input_table inside of the "Python Script" node to the console.
could you please try to use the 'Time to String' node instead of the 'Rename' node to convert your time? If you look at the table specification of the output tables of both nodes you can see a difference. The 'Rename' node results in a column of type
The 'Time to String' node results in a column of type
StringCell
Both look like String-columns in the table view. (And I still don't know when people would need to change the column type via the 'Rename' node - I avoid this).
I get the same warning (Milliseconds are not supported by this instance), so I tried putting time to string conversion in between. As a result the warnings disappear and I get a large speedup of 3.8x (312185ms vs. 82582ms) for 41k rows. However, my timestamp does not contain milliseconds (using the mask date node). Not sure this is expected behaviour? (Knime 3.1.2, Python 2.7.11)