Loading data from PipelineDB into SFrame, Cannot convert type 'Decimal' into flexible type.

User 151 | 3/24/2016, 6:18:00 PM

I am trying to loading data from PipelineDB, one timeseries data using PostgreSQL, have error "Cannot convert type 'Decimal' into flexible type." Do you have some suggestion?

import psycopg2
conn = psycopg2.connect('dbname=pipeline user=pipeline host=localhost port=5432')

# The below one works, great!
sf = gl.SFrame.from_sql(conn, "select rt,avg_rssi  from client_stats_1m limit 10") #select * from client_stats_1m l") 
sf.head()

#Failed due to 
sf = gl.SFrame.from_sql(conn, "select rt, avg_nclients from client_stats_1m") #select * from client_stats_1m l") 

TypeError Traceback (most recent call last) <ipython-input-33-2f0d441e64fc> in <module>() ----> 1 sf = gl.SFrame.fromsql(conn, "select rt,avgnclients from clientstats1m") 2

/usr/local/lib/python2.7/site-packages/graphlab/datastructures/sframe.pyc in fromsql(cls, conn, sqlstatement, params, typeinferencerows, dbapimodule, columntypehints, cursorarraysize) 2255 2256 sb = SFrameBuilder(resulttypes, columnnames=resultnames) -> 2257 sb.appendmultiple(tempvals) 2258 rows = c.fetchmany() 2259 while len(rows) > 0:

/usr/local/lib/python2.7/site-packages/graphlab/datastructures/sframebuilder.pyc in appendmultiple(self, data, segment) 157 if hasattr(data, 'len'): 158 if len(data) <= self.blocksize: --> 159 self.builder.append_multiple(data, segment) 160 return 161

graphlab/cython/cysframebuilder.pyx in graphlab.cython.cysframebuilder.UnitySFrameBuilderProxy.append_multiple()

graphlab/cython/cysframebuilder.pyx in graphlab.cython.cysframebuilder.UnitySFrameBuilderProxy.append_multiple()

graphlab/cython/cyflexibletype.pyx in graphlab.cython.cyflexibletype.flexlistfrom_iterable()

graphlab/cython/cyflexibletype.pyx in graphlab.cython.cyflexibletype.commontypedflexlistfrom_iterable()

graphlab/cython/cyflexibletype.pyx in graphlab.cython.cyflexibletype.fill_list()

graphlab/cython/cyflexibletype.pyx in graphlab.cython.cyflexibletype.fttranslate()

TypeError: Cannot convert type 'Decimal' into flexible type.

pipeline = conn.cursor()
pipeline.execute("select  rt,avg_nclients  from client_stats_1m limit 5")

rows = pipeline.fetchall()
for row in rows:
		print row,"\n"


(datetime.datetime(2016, 3, 24, 17, 13, 10, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)), Decimal('3.0000000000000000')) 

(datetime.datetime(2016, 3, 24, 15, 25, 10, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)), Decimal('3.0000000000000000')) 

(datetime.datetime(2016, 3, 24, 15, 47, 10, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)), Decimal('1.00000000000000000000')) 

(datetime.datetime(2016, 3, 24, 16, 58, 20, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)), Decimal('2.0000000000000000')) 

(datetime.datetime(2016, 3, 24, 17, 57, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)), Decimal('3.0000000000000000')) 

Comments

User 151 | 3/24/2016, 6:44:50 PM

ok, I see the problem go away AFTER I upgrade to graphlab v1.8.5 .