ValueError('Must stream updates to all existing columns (missing: index)',)

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

Please see this mailing list thread for a discussion of the same situation:

  Redirecting to Google Groups

Thanks,

Bryan

···

On Mar 6, 2017, at 08:43, MrShookshank <[email protected]> wrote:

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

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5eabbe55-e6cf-44dc-976f-b6118bd873bc%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.