I used to work with pandas and cx_Oracle until now. But I haver to switch to dask now due to RAM limitations.
JavaScript
x
13
13
1
import pandas as pd
2
from dask import dataframe as dd
3
import os
4
import cx_Oracle as cx
5
6
7
con = cx.connect('USER','userpw' , 'oracle_db',encoding='utf-8')
8
cursor = con.cursor()
9
10
query_V_Branchen = ('''SELECT * FROM DBOWNER.V_BRANCHEN vb''')
11
12
daskdf = dd.read_sql_table(query_V_Branchen,con ,index_col= 'RECID')
13
I tried to do it similar to how I used cx_oracle with pandas. But I receive an AttributeError named:
JavaScript
1
2
1
'cx_Oracle.Connection' object has no attribute '_instantiate_plugins'
2
Any ideas if its just a problem with the package?
Advertisement
Answer
Please read the dask doc on SQL:
you should provide a connection string, not an object
you should give a table name, not a query, or phrase your query using sqlalchemy’s expression syntax.
e.g.,
JavaScript
1
3
1
df = dd.read_sql_table('DBOWNER.V_BRANCHEN',
2
'oracle+cx_oracle://USER:userpw@oracle_db', index_col= 'RECID')
3