Giter Club home page Giter Club logo

Comments (4)

ttrifonov avatar ttrifonov commented on July 26, 2024

Actually it might be a problem with str-unicode conversion.

Another snippet of code:

q = client.query('logs', 'demo1')
q.where(p.equals('uuid', '12b9996cbd45492091d0daf17da3b5b9'))
q.foreach(callback)

Nothing returned. Trying scan:

q = client.scan('logs', 'demo1')
q.select('uuid')

def callback(r):
    if r[2]['uuid'] == '12b9996cbd45492091d0daf17da3b5b9': print r

q.foreach(callback)

Prints: (('logs', 'demo1', None,
    bytearray(b'\xe4\x1c\xb5VNw\x1aO#+_\xd7\xf8\x84\x81\xbdCz|\xff')),
    {'gen': 1, 'ttl': 2591537},
    {'uuid': u'12b9996cbd45492091d0daf17da3b5b9'})

So the record is actually there, but where cannot it find due to unknown reason. If I try to set the where as unicode - I get the following error:

q.where(p.equals('uuid', u'12b9996cbd45492091d0daf17da3b5b9'))
(-2L, 'predicate is invalid.', 'src/main/query/where.c', 225)

from aerospike-client-python.

ttrifonov avatar ttrifonov commented on July 26, 2024

Hmm, it seems the problem is with IPython... I can't believe it but...

When pasting the following lines one by one:

In [47]: q = client.query('logs2', 'ORG-demo')

In [48]: 

In [48]: q.where(p.equals('owner', 'demo'))
Out[48]: <aerospike.Query at 0x7fc5345fa670>

In [49]: 

In [49]: q.foreach(callback)
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-49-fdc57a57e0c2> in <module>()
----> 1 q.foreach(callback)

Exception: (204L, 'AEROSPIKE_ERR_INDEX', None, None)

I got an error. If I copy them and use %paste:

In [50]: %paste
q = client.query('logs2', 'ORG-demo')
q.where(p.equals('owner', 'demo'))
q.foreach(callback)
## -- End pasted text --
{'uuid': u'8928a8aed6d949489e30d9d529afbcb6', 'owner': u'demo'}
{'uuid': u'76d51d830925402a88a9ccfeabb7efa1', 'owner': u'demo'}

I'll continue thinking on what might cause this, but the bug seems invalid anyway.

from aerospike-client-python.

rbotzer avatar rbotzer commented on July 26, 2024

Huh, that's odd. If you reopen, please add the OS, version of Python you're using and which client release you're on.

Thanks!

from aerospike-client-python.

ttrifonov avatar ttrifonov commented on July 26, 2024

I'm using Ubuntu 14.10, python 2.7, aerospike 1.0.34, latest from PyPI. Running code from an application seems fine, no worries. It is just IPython behaving strange.

from aerospike-client-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.