Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor has no object prepare ! #123

Open
multinucliated opened this issue Dec 21, 2018 · 0 comments
Open

Cursor has no object prepare ! #123

multinucliated opened this issue Dec 21, 2018 · 0 comments

Comments

@multinucliated
Copy link

multinucliated commented Dec 21, 2018

code

from django.db import connection
import pandas as pd

session = connection.cursor()

print(pd.DataFrame(session.execute("SELECT * FROM weldcalculation LIMIT 1")[:]).shape)

print("This runs fine !")

print(session , type(session))

print(pd.DataFrame(session.prepare("SELECT * FROM weldcalculation LIMIT 10")[:]).shape)

output

(1,12)
This runs fine !
<django_cassandra_engine.utils.CursorWrapper object at 0x7f2fb8d21c88> <class'django_cassandra_engine.utils.CursorWrapper'>

File "/home/livnsense/Documents/Anshul/testing/asset_monitoring/backendservices/views.py", line 29, in
print(pd.DataFrame(session.prepare("SELECT * FROM weldcalculation LIMIT 10")[:]).shape)
File "/usr/local/lib/python3.5/dist-packages/django_cassandra_engine/utils.py", line 23, in getattr
cursor_attr = getattr(self.cursor, attr)
AttributeError: 'Cursor' object has no attribute 'prepare'

May I know what I'm doing wrong ? How can i solve this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant