sfu-db / connector-x

Fastest library to load data from DB to DataFrames in Rust and Python
https://sfu-db.github.io/connector-x
MIT License
1.94k stars 154 forks source link

Time out error for oracle and sql server databases #676

Open mellasmpa opened 1 month ago

mellasmpa commented 1 month ago

What language are you using?

Replace this text with the Python.

What version are you using?

I am using python 3.11.5

What database are you using?

Oracle and Sqlserver

What dataframe are you using?

Pandas

Can you describe your bug?

What are the steps to reproduce the behavior?

If possible, please include a minimal simple example including:

Database setup if the error only happens on specific data or data type

Table schema and example data

Example query / code
import connectorx as cx
import pandas as pd
from sqlalchemy import create_engine

query = "select * FROM awunadm.sad_item where rownum < 10"
conn = "oracle://username:password@ip:1521/db_name"
engine = create_engine("oracle+cx_oracle://username:password@ip:1521/db_name")

pd.read_sql(sql=query, con=engine)  # A version that works with sqlalchemy
cx.read_sql(conn=conn, query=query)  # A version that does not work with connectorx

#Note that for some of my oracle databases this works well using both sqlalchemy and connectorx

What is the error?

RuntimeError: timed out waiting for connection: OCI Error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

RaphCodec commented 1 week ago

Hi

I've been having the same problem when using the latest version of connectorx. However, I had an old environement with connectorx==0.3.2 and that version works with MS SQL Server without any issue. Not sure what changed between that version and the latest version. I can't verify with oracle as I have not figured out the oracle syntax for connecting with a tns yet. Hope this helps a little.