New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

mobiledreamers
Hey Gasol wu
i regenerated the new thrift interface using
thrift -gen py cassandra.thrift



client.insert('Table1', 'tofu', 'Super1:Related:tofu stew', pickle.dumps(dict(count=1)), time.time(), 0)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/mark/work/cexperiments/<ipython console> in <module>()

/home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key, column_path, value, timestamp, block_for)
    358      - block_for
    359     """
--> 360     self.send_insert(table, key, column_path, value, timestamp, block_for)
    361     self.recv_insert()
    362

/home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table, key, column_path, value, timestamp, block_for)
    370     args.timestamp = timestamp
    371     args.block_for = block_for
--> 372     args.write(self._oprot)
    373     self._oprot.writeMessageEnd()
    374     self._oprot.trans.flush()

/home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
   1923     if self.column_path != None:
   1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
-> 1925       self.column_path.write(oprot)
   1926       oprot.writeFieldEnd()
   1927     if self.value != None:

AttributeError: 'str' object has no attribute 'write'


On Sun, Jul 19, 2009 at 10:29 AM, Gasol Wu <[hidden email]> wrote:
hi,
the cassandra.thrift has changed.
u need to generate new python client and compile class again.



On Mon, Jul 20, 2009 at 1:18 AM, <[hidden email]> wrote:
Hi guys 
the new trunk cassandra doesnt work for a simple insert, how do we get this working

client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',pickle.dumps(dict(count=1)), time.time(), 0)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/mark/work/cexperiments/<ipython console> in <module>()

/home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key, column_path, value, timestamp, block_for)
    358      - block_for
    359     """
--> 360     self.send_insert(table, key, column_path, value, timestamp, block_for)
    361     self.recv_insert()
    362

/home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table, key, column_path, value, timestamp, block_for)
    370     args.timestamp = timestamp
    371     args.block_for = block_for
--> 372     args.write(self._oprot)
    373     self._oprot.writeMessageEnd()
    374     self._oprot.trans.flush()

/home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
   1923     if self.column_path != None:
   1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
-> 1925       self.column_path.write(oprot)
   1926       oprot.writeFieldEnd()
   1927     if self.value != None:

AttributeError: 'str' object has no attribute 'write'
In [4]: client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',pickle.dumps(dict(count=1)), time.time(), 0)


--
Bidegg worlds best auction site
http://bidegg.com




--
Bidegg worlds best auction site
http://bidegg.com
Reply | Threaded
Open this post in threaded view
|

Re: New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

Jonathan Ellis-3
Don't run trunk if you're not going to read "svn log."

The api changed with the commit of the 139 patches (and it will change
again with the 185 ones).

look at interface/cassandra.thrift to see what arguments are expected.

On Sun, Jul 19, 2009 at 3:31 PM, <[hidden email]> wrote:

> Hey Gasol wu
> i regenerated the new thrift interface using
> thrift -gen py cassandra.thrift
>
>
>
> client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',
> pickle.dumps(dict(count=1)), time.time(), 0)
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
>
> /home/mark/work/cexperiments/<ipython console> in <module>()
>
> /home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key,
> column_path, value, timestamp, block_for)
>     358      - block_for
>     359     """
> --> 360     self.send_insert(table, key, column_path, value, timestamp,
> block_for)
>     361     self.recv_insert()
>     362
>
> /home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table,
> key, column_path, value, timestamp, block_for)
>     370     args.timestamp = timestamp
>     371     args.block_for = block_for
> --> 372     args.write(self._oprot)
>     373     self._oprot.writeMessageEnd()
>     374     self._oprot.trans.flush()
>
> /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>    1923     if self.column_path != None:
>    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
> -> 1925       self.column_path.write(oprot)
>    1926       oprot.writeFieldEnd()
>    1927     if self.value != None:
>
> AttributeError: 'str' object has no attribute 'write'
>
>
> On Sun, Jul 19, 2009 at 10:29 AM, Gasol Wu <[hidden email]> wrote:
>>
>> hi,
>> the cassandra.thrift has changed.
>> u need to generate new python client and compile class again.
>>
>>
>> On Mon, Jul 20, 2009 at 1:18 AM, <[hidden email]> wrote:
>>>
>>> Hi guys
>>> the new trunk cassandra doesnt work for a simple insert, how do we get
>>> this working
>>> client.insert('Table1', 'tofu', 'Super1:Related:tofu
>>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>>>
>>> ---------------------------------------------------------------------------
>>> AttributeError                            Traceback (most recent call
>>> last)
>>> /home/mark/work/cexperiments/<ipython console> in <module>()
>>> /home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key,
>>> column_path, value, timestamp, block_for)
>>>     358      - block_for
>>>     359     """
>>> --> 360     self.send_insert(table, key, column_path, value, timestamp,
>>> block_for)
>>>     361     self.recv_insert()
>>>     362
>>> /home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table,
>>> key, column_path, value, timestamp, block_for)
>>>     370     args.timestamp = timestamp
>>>     371     args.block_for = block_for
>>> --> 372     args.write(self._oprot)
>>>     373     self._oprot.writeMessageEnd()
>>>     374     self._oprot.trans.flush()
>>> /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>>>    1923     if self.column_path != None:
>>>    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
>>> -> 1925       self.column_path.write(oprot)
>>>    1926       oprot.writeFieldEnd()
>>>    1927     if self.value != None:
>>> AttributeError: 'str' object has no attribute 'write'
>>> In [4]: client.insert('Table1', 'tofu', 'Super1:Related:tofu
>>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>>>
>>> --
>>> Bidegg worlds best auction site
>>> http://bidegg.com
>>
>
>
>
> --
> Bidegg worlds best auction site
> http://bidegg.com
>
Reply | Threaded
Open this post in threaded view
|

Re: New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

rkmr.em@gmail.com
In reply to this post by mobiledreamers
i can confirm the same problem too.
i got all the latest thrift, cassandra from trunk, built cassandra with ant, and python client with thrift and interface/cassandra.interface


client.insert('Table1', '1', 'Standard1:name', 'Nice', 1, False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cassandra/Cassandra.py", line 360, in insert
    self.send_insert(table, key, column_path, value, timestamp, block_for)
  File "cassandra/Cassandra.py", line 372, in send_insert
    args.write(self._oprot)
  File "cassandra/Cassandra.py", line 1925, in write
    self.column_path.write(oprot)
AttributeError: 'str' object has no attribute 'write'


can you guys please look into this.



On Sun, Jul 19, 2009 at 1:31 PM, <[hidden email]> wrote:
Hey Gasol wu
i regenerated the new thrift interface using
thrift -gen py cassandra.thrift



client.insert('Table1', 'tofu', 'Super1:Related:tofu stew', pickle.dumps(dict(count=1)), time.time(), 0)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/mark/work/cexperiments/<ipython console> in <module>()

/home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key, column_path, value, timestamp, block_for)
    358      - block_for
    359     """
--> 360     self.send_insert(table, key, column_path, value, timestamp, block_for)
    361     self.recv_insert()
    362

/home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table, key, column_path, value, timestamp, block_for)
    370     args.timestamp = timestamp
    371     args.block_for = block_for
--> 372     args.write(self._oprot)
    373     self._oprot.writeMessageEnd()
    374     self._oprot.trans.flush()

/home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
   1923     if self.column_path != None:
   1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
-> 1925       self.column_path.write(oprot)
   1926       oprot.writeFieldEnd()
   1927     if self.value != None:

AttributeError: 'str' object has no attribute 'write'


On Sun, Jul 19, 2009 at 10:29 AM, Gasol Wu <[hidden email]> wrote:
hi,
the cassandra.thrift has changed.
u need to generate new python client and compile class again.



On Mon, Jul 20, 2009 at 1:18 AM, <[hidden email]> wrote:
Hi guys 
the new trunk cassandra doesnt work for a simple insert, how do we get this working

client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',pickle.dumps(dict(count=1)), time.time(), 0)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/mark/work/cexperiments/<ipython console> in <module>()

/home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key, column_path, value, timestamp, block_for)
    358      - block_for
    359     """
--> 360     self.send_insert(table, key, column_path, value, timestamp, block_for)
    361     self.recv_insert()
    362

/home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table, key, column_path, value, timestamp, block_for)
    370     args.timestamp = timestamp
    371     args.block_for = block_for
--> 372     args.write(self._oprot)
    373     self._oprot.writeMessageEnd()
    374     self._oprot.trans.flush()

/home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
   1923     if self.column_path != None:
   1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
-> 1925       self.column_path.write(oprot)
   1926       oprot.writeFieldEnd()
   1927     if self.value != None:

AttributeError: 'str' object has no attribute 'write'
In [4]: client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',pickle.dumps(dict(count=1)), time.time(), 0)


--
Bidegg worlds best auction site
http://bidegg.com




--
Bidegg worlds best auction site
http://bidegg.com

Reply | Threaded
Open this post in threaded view
|

Re: New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

mobiledreamers
In reply to this post by Jonathan Ellis-3
ok
so which is the version where cassandra python thrift works out of the box
thanks

On 7/19/09, Jonathan Ellis <[hidden email]> wrote:
Don't run trunk if you're not going to read "svn log."

The api changed with the commit of the 139 patches (and it will change
again with the 185 ones).

look at interface/cassandra.thrift to see what arguments are expected.


On Sun, Jul 19, 2009 at 3:31 PM, <[hidden email]> wrote:
> Hey Gasol wu
> i regenerated the new thrift interface using
> thrift -gen py cassandra.thrift
>
>
>
> client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',
> pickle.dumps(dict(count=1)), time.time(), 0)
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
>
> /home/mark/work/cexperiments/<ipython console> in <module>()
>
> /home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key,
> column_path, value, timestamp, block_for)
>     358      - block_for
>     359     """
> --> 360     self.send_insert(table, key, column_path, value, timestamp,
> block_for)
>     361     self.recv_insert()
>     362
>
> /home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table,
> key, column_path, value, timestamp, block_for)
>     370     args.timestamp = timestamp
>     371     args.block_for = block_for
> --> 372     args.write(self._oprot)
>     373     self._oprot.writeMessageEnd()
>     374     self._oprot.trans.flush()
>
> /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>    1923     if self.column_path != None:
>    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
> -> 1925       self.column_path.write(oprot)
>    1926       oprot.writeFieldEnd()
>    1927     if self.value != None:
>
> AttributeError: 'str' object has no attribute 'write'
>
>
> On Sun, Jul 19, 2009 at 10:29 AM, Gasol Wu <[hidden email]> wrote:
>>
>> hi,
>> the cassandra.thrift has changed.
>> u need to generate new python client and compile class again.
>>
>>
>> On Mon, Jul 20, 2009 at 1:18 AM, <[hidden email]> wrote:
>>>
>>> Hi guys
>>> the new trunk cassandra doesnt work for a simple insert, how do we get
>>> this working
>>> client.insert('Table1', 'tofu', 'Super1:Related:tofu
>>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>>>
>>> ---------------------------------------------------------------------------
>>> AttributeError                            Traceback (most recent call
>>> last)
>>> /home/mark/work/cexperiments/<ipython console> in <module>()
>>> /home/mark/work/common/cassandra/Cassandra.py in insert(self, table, key,
>>> column_path, value, timestamp, block_for)
>>>     358      - block_for
>>>     359     """
>>> --> 360     self.send_insert(table, key, column_path, value, timestamp,
>>> block_for)
>>>     361     self.recv_insert()
>>>     362
>>> /home/mark/work/common/cassandra/Cassandra.py in send_insert(self, table,
>>> key, column_path, value, timestamp, block_for)
>>>     370     args.timestamp = timestamp
>>>     371     args.block_for = block_for
>>> --> 372     args.write(self._oprot)
>>>     373     self._oprot.writeMessageEnd()
>>>     374     self._oprot.trans.flush()
>>> /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>>>    1923     if self.column_path != None:
>>>    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
>>> -> 1925       self.column_path.write(oprot)
>>>    1926       oprot.writeFieldEnd()
>>>    1927     if self.value != None:
>>> AttributeError: 'str' object has no attribute 'write'
>>> In [4]: client.insert('Table1', 'tofu', 'Super1:Related:tofu
>>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>>>
>>> --
>>> Bidegg worlds best auction site
>>> http://bidegg.com
>>
>
>
>
> --
> Bidegg worlds best auction site
> http://bidegg.com
>



--
Bidegg worlds best auction site
http://bidegg.com
Reply | Threaded
Open this post in threaded view
|

Re: New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

Ian Holsman-3
hi mobile.
is it possible to put these as JIRA bugs ? instead of just mailing  
them on the list ?

that way people can give them a bit more attention. and other people  
who have the same issue will be easily see what is going on.

the URL is here :- https://issues.apache.org/jira/browse/CASSANDRA
regards
Ian

On 20/07/2009, at 6:36 AM, [hidden email] wrote:

> ok
> so which is the version where cassandra python thrift works out of  
> the box
> thanks
>
> On 7/19/09, Jonathan Ellis <[hidden email]> wrote: Don't run  
> trunk if you're not going to read "svn log."
>
> The api changed with the commit of the 139 patches (and it will change
> again with the 185 ones).
>
> look at interface/cassandra.thrift to see what arguments are expected.
>
>
> On Sun, Jul 19, 2009 at 3:31 PM, <[hidden email]> wrote:
> > Hey Gasol wu
> > i regenerated the new thrift interface using
> > thrift -gen py cassandra.thrift
> >
> >
> >
> > client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',
> > pickle.dumps(dict(count=1)), time.time(), 0)
> >  
> ---------------------------------------------------------------------------
> > AttributeError                            Traceback (most recent  
> call last)
> >
> > /home/mark/work/cexperiments/<ipython console> in <module>()
> >
> > /home/mark/work/common/cassandra/Cassandra.py in insert(self,  
> table, key,
> > column_path, value, timestamp, block_for)
> >     358      - block_for
> >     359     """
> > --> 360     self.send_insert(table, key, column_path, value,  
> timestamp,
> > block_for)
> >     361     self.recv_insert()
> >     362
> >
> > /home/mark/work/common/cassandra/Cassandra.py in send_insert(self,  
> table,
> > key, column_path, value, timestamp, block_for)
> >     370     args.timestamp = timestamp
> >     371     args.block_for = block_for
> > --> 372     args.write(self._oprot)
> >     373     self._oprot.writeMessageEnd()
> >     374     self._oprot.trans.flush()
> >
> > /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
> >    1923     if self.column_path != None:
> >    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
> > -> 1925       self.column_path.write(oprot)
> >    1926       oprot.writeFieldEnd()
> >    1927     if self.value != None:
> >
> > AttributeError: 'str' object has no attribute 'write'
> >
> >
> > On Sun, Jul 19, 2009 at 10:29 AM, Gasol Wu <[hidden email]>  
> wrote:
> >>
> >> hi,
> >> the cassandra.thrift has changed.
> >> u need to generate new python client and compile class again.
> >>
> >>
> >> On Mon, Jul 20, 2009 at 1:18 AM, <[hidden email]> wrote:
> >>>
> >>> Hi guys
> >>> the new trunk cassandra doesnt work for a simple insert, how do  
> we get
> >>> this working
> >>> client.insert('Table1', 'tofu', 'Super1:Related:tofu
> >>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
> >>>
> >>>  
> ---------------------------------------------------------------------------
> >>> AttributeError                            Traceback (most recent  
> call
> >>> last)
> >>> /home/mark/work/cexperiments/<ipython console> in <module>()
> >>> /home/mark/work/common/cassandra/Cassandra.py in insert(self,  
> table, key,
> >>> column_path, value, timestamp, block_for)
> >>>     358      - block_for
> >>>     359     """
> >>> --> 360     self.send_insert(table, key, column_path, value,  
> timestamp,
> >>> block_for)
> >>>     361     self.recv_insert()
> >>>     362
> >>> /home/mark/work/common/cassandra/Cassandra.py in  
> send_insert(self, table,
> >>> key, column_path, value, timestamp, block_for)
> >>>     370     args.timestamp = timestamp
> >>>     371     args.block_for = block_for
> >>> --> 372     args.write(self._oprot)
> >>>     373     self._oprot.writeMessageEnd()
> >>>     374     self._oprot.trans.flush()
> >>> /home/mark/work/common/cassandra/Cassandra.py in write(self,  
> oprot)
> >>>    1923     if self.column_path != None:
> >>>    1924       oprot.writeFieldBegin('column_path', TType.STRUCT,  
> 3)
> >>> -> 1925       self.column_path.write(oprot)
> >>>    1926       oprot.writeFieldEnd()
> >>>    1927     if self.value != None:
> >>> AttributeError: 'str' object has no attribute 'write'
> >>> In [4]: client.insert('Table1', 'tofu', 'Super1:Related:tofu
> >>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
> >>>
> >>> --
> >>> Bidegg worlds best auction site
> >>> http://bidegg.com
> >>
> >
> >
> >
> > --
> > Bidegg worlds best auction site
> > http://bidegg.com
> >
>
>
>
> --
> Bidegg worlds best auction site
> http://bidegg.com

--
Ian Holsman
[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

Jonathan Ellis-3
For the record, this is not actually a bug, and if you're not sure,
asking on the list before filing a report in JIRA is probably a good
thing.

On Sun, Jul 19, 2009 at 6:45 PM, Ian Holsman<[hidden email]> wrote:

> hi mobile.
> is it possible to put these as JIRA bugs ? instead of just mailing them on
> the list ?
>
> that way people can give them a bit more attention. and other people who
> have the same issue will be easily see what is going on.
>
> the URL is here :- https://issues.apache.org/jira/browse/CASSANDRA
> regards
> Ian
>
> On 20/07/2009, at 6:36 AM, [hidden email] wrote:
>
>> ok
>> so which is the version where cassandra python thrift works out of the box
>> thanks
>>
>> On 7/19/09, Jonathan Ellis <[hidden email]> wrote: Don't run trunk if
>> you're not going to read "svn log."
>>
>> The api changed with the commit of the 139 patches (and it will change
>> again with the 185 ones).
>>
>> look at interface/cassandra.thrift to see what arguments are expected.
>>
>>
>> On Sun, Jul 19, 2009 at 3:31 PM, <[hidden email]> wrote:
>> > Hey Gasol wu
>> > i regenerated the new thrift interface using
>> > thrift -gen py cassandra.thrift
>> >
>> >
>> >
>> > client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',
>> > pickle.dumps(dict(count=1)), time.time(), 0)
>> >
>> > ---------------------------------------------------------------------------
>> > AttributeError                            Traceback (most recent call
>> > last)
>> >
>> > /home/mark/work/cexperiments/<ipython console> in <module>()
>> >
>> > /home/mark/work/common/cassandra/Cassandra.py in insert(self, table,
>> > key,
>> > column_path, value, timestamp, block_for)
>> >     358      - block_for
>> >     359     """
>> > --> 360     self.send_insert(table, key, column_path, value, timestamp,
>> > block_for)
>> >     361     self.recv_insert()
>> >     362
>> >
>> > /home/mark/work/common/cassandra/Cassandra.py in send_insert(self,
>> > table,
>> > key, column_path, value, timestamp, block_for)
>> >     370     args.timestamp = timestamp
>> >     371     args.block_for = block_for
>> > --> 372     args.write(self._oprot)
>> >     373     self._oprot.writeMessageEnd()
>> >     374     self._oprot.trans.flush()
>> >
>> > /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>> >    1923     if self.column_path != None:
>> >    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
>> > -> 1925       self.column_path.write(oprot)
>> >    1926       oprot.writeFieldEnd()
>> >    1927     if self.value != None:
>> >
>> > AttributeError: 'str' object has no attribute 'write'
>> >
>> >
>> > On Sun, Jul 19, 2009 at 10:29 AM, Gasol Wu <[hidden email]> wrote:
>> >>
>> >> hi,
>> >> the cassandra.thrift has changed.
>> >> u need to generate new python client and compile class again.
>> >>
>> >>
>> >> On Mon, Jul 20, 2009 at 1:18 AM, <[hidden email]> wrote:
>> >>>
>> >>> Hi guys
>> >>> the new trunk cassandra doesnt work for a simple insert, how do we get
>> >>> this working
>> >>> client.insert('Table1', 'tofu', 'Super1:Related:tofu
>> >>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>> >>>
>> >>>
>> >>> ---------------------------------------------------------------------------
>> >>> AttributeError                            Traceback (most recent call
>> >>> last)
>> >>> /home/mark/work/cexperiments/<ipython console> in <module>()
>> >>> /home/mark/work/common/cassandra/Cassandra.py in insert(self, table,
>> >>> key,
>> >>> column_path, value, timestamp, block_for)
>> >>>     358      - block_for
>> >>>     359     """
>> >>> --> 360     self.send_insert(table, key, column_path, value,
>> >>> timestamp,
>> >>> block_for)
>> >>>     361     self.recv_insert()
>> >>>     362
>> >>> /home/mark/work/common/cassandra/Cassandra.py in send_insert(self,
>> >>> table,
>> >>> key, column_path, value, timestamp, block_for)
>> >>>     370     args.timestamp = timestamp
>> >>>     371     args.block_for = block_for
>> >>> --> 372     args.write(self._oprot)
>> >>>     373     self._oprot.writeMessageEnd()
>> >>>     374     self._oprot.trans.flush()
>> >>> /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>> >>>    1923     if self.column_path != None:
>> >>>    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
>> >>> -> 1925       self.column_path.write(oprot)
>> >>>    1926       oprot.writeFieldEnd()
>> >>>    1927     if self.value != None:
>> >>> AttributeError: 'str' object has no attribute 'write'
>> >>> In [4]: client.insert('Table1', 'tofu', 'Super1:Related:tofu
>> >>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>> >>>
>> >>> --
>> >>> Bidegg worlds best auction site
>> >>> http://bidegg.com
>> >>
>> >
>> >
>> >
>> > --
>> > Bidegg worlds best auction site
>> > http://bidegg.com
>> >
>>
>>
>>
>> --
>> Bidegg worlds best auction site
>> http://bidegg.com
>
> --
> Ian Holsman
> [hidden email]
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: New cassandra in trunk - breaks python thrift interface (was AttributeError: 'str' object has no attribute 'write')

Jonathan Ellis-3
In reply to this post by mobiledreamers
It works fine, it's just not the same as it was two weeks ago.

On Sun, Jul 19, 2009 at 3:36 PM, <[hidden email]> wrote:

> ok
> so which is the version where cassandra python thrift works out of the box
> thanks
>
> On 7/19/09, Jonathan Ellis <[hidden email]> wrote:
>>
>> Don't run trunk if you're not going to read "svn log."
>>
>> The api changed with the commit of the 139 patches (and it will change
>> again with the 185 ones).
>>
>> look at interface/cassandra.thrift to see what arguments are expected.
>>
>>
>> On Sun, Jul 19, 2009 at 3:31 PM, <[hidden email]> wrote:
>> > Hey Gasol wu
>> > i regenerated the new thrift interface using
>> > thrift -gen py cassandra.thrift
>> >
>> >
>> >
>> > client.insert('Table1', 'tofu', 'Super1:Related:tofu stew',
>> > pickle.dumps(dict(count=1)), time.time(), 0)
>> >
>> > ---------------------------------------------------------------------------
>> > AttributeError                            Traceback (most recent call
>> > last)
>> >
>> > /home/mark/work/cexperiments/<ipython console> in <module>()
>> >
>> > /home/mark/work/common/cassandra/Cassandra.py in insert(self, table,
>> > key,
>> > column_path, value, timestamp, block_for)
>> >     358      - block_for
>> >     359     """
>> > --> 360     self.send_insert(table, key, column_path, value, timestamp,
>> > block_for)
>> >     361     self.recv_insert()
>> >     362
>> >
>> > /home/mark/work/common/cassandra/Cassandra.py in send_insert(self,
>> > table,
>> > key, column_path, value, timestamp, block_for)
>> >     370     args.timestamp = timestamp
>> >     371     args.block_for = block_for
>> > --> 372     args.write(self._oprot)
>> >     373     self._oprot.writeMessageEnd()
>> >     374     self._oprot.trans.flush()
>> >
>> > /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>> >    1923     if self.column_path != None:
>> >    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
>> > -> 1925       self.column_path.write(oprot)
>> >    1926       oprot.writeFieldEnd()
>> >    1927     if self.value != None:
>> >
>> > AttributeError: 'str' object has no attribute 'write'
>> >
>> >
>> > On Sun, Jul 19, 2009 at 10:29 AM, Gasol Wu <[hidden email]> wrote:
>> >>
>> >> hi,
>> >> the cassandra.thrift has changed.
>> >> u need to generate new python client and compile class again.
>> >>
>> >>
>> >> On Mon, Jul 20, 2009 at 1:18 AM, <[hidden email]> wrote:
>> >>>
>> >>> Hi guys
>> >>> the new trunk cassandra doesnt work for a simple insert, how do we get
>> >>> this working
>> >>> client.insert('Table1', 'tofu', 'Super1:Related:tofu
>> >>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>> >>>
>> >>>
>> >>> ---------------------------------------------------------------------------
>> >>> AttributeError                            Traceback (most recent call
>> >>> last)
>> >>> /home/mark/work/cexperiments/<ipython console> in <module>()
>> >>> /home/mark/work/common/cassandra/Cassandra.py in insert(self, table,
>> >>> key,
>> >>> column_path, value, timestamp, block_for)
>> >>>     358      - block_for
>> >>>     359     """
>> >>> --> 360     self.send_insert(table, key, column_path, value,
>> >>> timestamp,
>> >>> block_for)
>> >>>     361     self.recv_insert()
>> >>>     362
>> >>> /home/mark/work/common/cassandra/Cassandra.py in send_insert(self,
>> >>> table,
>> >>> key, column_path, value, timestamp, block_for)
>> >>>     370     args.timestamp = timestamp
>> >>>     371     args.block_for = block_for
>> >>> --> 372     args.write(self._oprot)
>> >>>     373     self._oprot.writeMessageEnd()
>> >>>     374     self._oprot.trans.flush()
>> >>> /home/mark/work/common/cassandra/Cassandra.py in write(self, oprot)
>> >>>    1923     if self.column_path != None:
>> >>>    1924       oprot.writeFieldBegin('column_path', TType.STRUCT, 3)
>> >>> -> 1925       self.column_path.write(oprot)
>> >>>    1926       oprot.writeFieldEnd()
>> >>>    1927     if self.value != None:
>> >>> AttributeError: 'str' object has no attribute 'write'
>> >>> In [4]: client.insert('Table1', 'tofu', 'Super1:Related:tofu
>> >>> stew',pickle.dumps(dict(count=1)), time.time(), 0)
>> >>>
>> >>> --
>> >>> Bidegg worlds best auction site
>> >>> http://bidegg.com
>> >>
>> >
>> >
>> >
>> > --
>> > Bidegg worlds best auction site
>> > http://bidegg.com
>> >
>
>
>
> --
> Bidegg worlds best auction site
> http://bidegg.com