Issues parsing pandas dataframe datetime columns (with NaT values) to knime table

Hi @strny , welcome to the forum and thanks for the very detailed investigation, this is much appreciated!

You are right, a NaT (not a time) value is currently not implemented in KNIME, as opposed to NaN's for floats. I will issue a feature request for that.

Meanwhile, I would opt for missing values (red questionmarks) instead of an arbitrary date as the ‘flag’ for NaTs and update your example to the following:

# Example code to replicate issue
import pandas as pd
from datetime import datetime
import numpy as np

example_data = [
	{'name':'Alice',
	 'dob':datetime(year=1995,month=6,day=20),
	 'num':np.nan},
	{'name':'Bob',
	 'dob':datetime(year=1997,month=3,day=7),
	 'num':float('nan')},
	{'name':'Charlie',
	 'dob':None,
	 'num':1.23},
	{'name':'Daisy',
	 'dob':float('nan'),
	 'num':None},
	 ]
	 
df = pd.DataFrame.from_records(example_data)

# NaT -> None -> ?
df.dob = df.dob.astype(object).where(df.dob.notnull(), None)

output_table = df

Hope that helps, and thanks again, best
Lukas

4 Likes