Bucket keys are strings and you're passing an int (data['Time(PDT)'] which you set to int(ut))
On Sat, Apr 2, 2011 at 6:13 PM, Mike Stoddart <[email protected]> wrote: > Just want to quickly clarify how to store timestamps in Riak Search > using Python. My code: > > dt = datetime.datetime.strptime(data['Time(PDT)'], "%b %d, > %Y %H:%M:%S") > ut = time.mktime(dt.timetuple()) > data['Time(PDT)'] = int(ut) > > # Save the object to Riak. > json = simplejson.dumps(data) > obj = bucket.new(data['Time(PDT)'], data=json) > obj.store(return_body=False) > > This is giving me: > > TypeError: 1275598830 has type <type 'int'>, but expected one of: > (<type 'str'>,) > > Am I misunderstanding something fundamental here? > > Thanks > Mike > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
