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 ?
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 ?