You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
The text was updated successfully, but these errors were encountered:
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 ?
The text was updated successfully, but these errors were encountered: