Hi Guys,
I’ve been battling an issue with streaming updates using the columndatasource.
bokeh version = 0.12.4
pandas version = 0.19.2
I have the following code which updates the data from some SQL queries.
def update():
df = pd.read_sql_query('SELECT * FROM event LEFT JOIN signature ON event.signature=signature.sig_id ’
‘LEFT JOIN sig_class ON signature.sig_class_id=sig_class.sig_class_id;’,
engine).dropna()
df2 = pd.read_sql_query('SELECT ip_src,ip_dst FROM iphdr;', engine)
df3 = pd.read_sql_query('SELECT tcp_sport, tcp_dport FROM tcphdr;', engine)
df1 = df.drop('sig_class_id', axis=1)
df4 = pd.concat([df1, df2, df3], axis=1, verify_integrity=True)
datadict = dict(
cid=df4[[‘cid’]],
ip_dst=df4[[‘ip_dst’]],
ip_src=df4[[‘ip_src’]],
sid=df4[[‘sid’]],
sig_class_name=df4[[‘sig_class_name’]],
sig_gid=df4[[‘sig_gid’]],
sig_id=df4[[‘sig_id’]],
sig_name=df4[[‘sig_name’]],
sig_priority=df4[[‘sig_priority’]],
sig_rev=df4[[‘sig_rev’]],
sig_sid=df4[[‘sig_sid’]],
signature=df4[[‘signature’]],
tcp_dport=df4[[‘tcp_dport’]],
tcp_sport=df4[[‘tcp_sport’]],
timestamp=df4[[‘timestamp’]]
)
source.stream(datadict, 300)
``
The error says im missing an index column however I do not have an index column in my data, only the fifteen shown by ‘datadict’
Cheers