aaronbenz / caspanda Goto Github PK
View Code? Open in Web Editor NEWUsing Pandas easily with Cassandra
License: MIT License
Using Pandas easily with Cassandra
License: MIT License
I have to use cql_version
in your constructor to get the proper version of the Cassandra driver parser. I am using the master
branch - I just cloned it this morning (April 15th).
python3 -c 'import cassandra; print(cassandra.__version__)'```
returns 3.17.0. And
```bash
apt list | grep cassandra
shows I'm using Cassandra 3.11.4. I'm on an unpatched Ubuntu 18.04.1 LTS system. I have to use
CasPanda(cql_version="5.0.1")
Otherwise, I get the error message
In [3]: cl = CasPanda()
In [4]: sess = cl.connect()
---------------------------------------------------------------------------
InvalidRequest Traceback (most recent call last)
<ipython-input-4-240a937d4155> in <module>
----> 1 sess = cl.connect()
/usr/local/lib/python3.6/dist-packages/caspanda-0.0.0.4-py3.6.egg/caspanda/bear.py in connect(self, kp)
36 self.session.row_factory = self.panda_factory
37 if self.keyspaces is None:
---> 38 self._sync_metadata(kp)
39
40 return self.session
/usr/local/lib/python3.6/dist-packages/caspanda-0.0.0.4-py3.6.egg/caspanda/bear.py in _sync_metadata(self, kp)
68 #gets all of the column data for all tables/keyspaces
69 result = self.session.execute("""SELECT keyspace_name, columnfamily_name, column_name, component_index, index_name,
---> 70 index_options, index_type, type as cql_type, validator FROM system.schema_columns""")
71
72
/usr/local/lib/python3.6/dist-packages/cassandra/cluster.cpython-36m-x86_64-linux-gnu.so in cassandra.cluster.Session.execute()
/usr/local/lib/python3.6/dist-packages/cassandra/cluster.cpython-36m-x86_64-linux-gnu.so in cassandra.cluster.ResponseFuture.result()
InvalidRequest: Error from server: code=2200 [Invalid query] message="unconfigured table schema_columns"
Any idea what my problem might be?
thanks
andy
from caspanda.bear import CasPanda
โ
cl = CasPanda()
ImportError Traceback (most recent call last)
in ()
----> 1 from caspanda.bear import CasPanda
2
3 cl = CasPanda()
4 session = cl.connect()
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/caspanda-0.0.0.4-py3.4.egg/caspanda/bear.py in ()
9 from caspanda.metabear import ColumnMeta, KeyspaceMeta, TableMeta
10 from cassandra.query import dict_factory
---> 11 from cassandra.cluster import _shutdown_cluster
12
13 from caspanda.bamboo import CassandraFrame
ImportError: cannot import name '_shutdown_cluster'
Your code uses some deprecated modules in bear.py at line no 10 use cassandra.query.dict_factory instead of cassandra.decoder.dict_factory
I've just downloaded and installed caspanda and I was trying to run a simple example but I got this error:
Traceback
(most recent call last):
File "caspanda_test.py", line 5, in
cpsession = cl.connect('demo_opcua')
File "/Users/agy/Working/industry-4.0/caspanda/caspanda/bear.py", line 37, in connect
self._sync_metadata(kp)
File "/Users/agy/Working/industry-4.0/caspanda/caspanda/bear.py", line 69, in _sync_metadata
index_options, index_type, type as cql_type, validator FROM system.schema_columns""")
File "cassandra/cluster.py", line 1941, in cassandra.cluster.Session.execute (cassandra/cluster.c:33642)
File "cassandra/cluster.py", line 3629, in cassandra.cluster.ResponseFuture.result (cassandra/cluster.c:69369)
cassandra.InvalidRequest: Error from server: code=2200 [Invalid query] message="unconfigured table schema_columns"`
The code I'm triying to run is the following:
from caspanda.bear import CasPanda
cl = CasPanda(['localhost'])
cpsession = cl.connect('demo_opcua')
Any idea what's wrong?
This query in bear.py is no longer valid
#gets all of the column data for all tables/keyspaces result = self.session.execute("""SELECT keyspace_name, columnfamily_name, column_name, component_index, index_name, index_options, index_type, type as cql_type, validator FROM system.schema_columns""")
The table system.schema_columns no longer exists. I could not find the columns component_index, index_options, index_type and type anywhere in other tables. columnfamily_name now appears to be table_name in system_schema.columns table along with keyspace_name and column_name
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.