AttributeError during pd.read_sql_table
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Reproduce the pd.read_sql_table example with SQLAlchemy 1.4.22 and databricks-sql-connector 2.9.3, then inspect src/databricks/sqlalchemy/base.py around line 360 and src/databricks/sqlalchemy/dialect/init.py around lines 247 and 299. Done means table reflection completes without the reported AttributeError.
Written by the indexing model from the issue text.
Description
SQLAlchemy version: 1.4.22
databricks-sql-connector version: 2.9.3
The following code throws the error below:
from sqlalchemy import create_engine
[...]
conn = create_engine(
f"databricks://token:{token}@{host}?http_path={path}"
"&catalog={catalog}&schema={schema}"
)
test = pd.read_sql_table(table, con=conn)
File "[REDACTED]\sqlalchemy\engine\reflection.py", line 266, in get_table_names
return self.dialect.get_table_names(
File "[REDACTED]\databricks\sqlalchemy\dialect_init_.py", line 247, in get_table_names
with self.get_connection_cursor(connection) as cur:
File "[REDACTED]\databricks\sqlalchemy\dialect_init_.py", line 299, in get_connection_cursor
return connection._dbapi_connection.dbapi_connection.cursor()
File "[REDACTED]\sqlalchemy\pool\base.py", line 985, in getattr
return getattr(self.connection, key)
AttributeError: 'Connection' object has no attribute 'dbapi_connection'
I believe the line linked below should read connection._dbapi_connection.cursor() (attr exists) instead of connection._dbapi_connection.dbapi_connection.cursor() (attr doesnt exist)
- Dominant language
- Python
- Stars
- 233
- Forks
- 152
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/databricks-sql-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
All issues in databricks/databricks-sql-python
Similar issues
-
fix: inaccuracy ⚠️
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
uabrc/uabrc.github.io#1255 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ethereum-optimism/factory#64 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
duckdb/duckdb-python#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Qiskit/qiskit-addon-sqd#376 ·