catherinedevlin / ipython-sql

%%sql magic for IPython, hopefully evolving into full SQL client
MIT License
1.79k stars 369 forks source link

Output of the query is returning empty result #148

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi there, I have installed sqlalchemy-vertica vertica_python, and I am using it in the JupyterNotebook with sql magic function %sql. (ipython-sql)

The connection is successfully made and the query runs but the result is empty, I see only the column names. %sql vertica+vertica_python://victorc:****@host/dbname result = %sql SELECT * FROM table_name LIMIT 10; The result is only the fields name.

I think this is somehow related to ipython-sql because if I connect to Vertica trough sqlalchemy_vertica library it work and I see the results. import sqlalchemy as sa import urllib

#installed the sqlalchemy_vertica vertica_python

#for vertica-python connection engine = sa.create_engine('vertica+vertica_python://victorc:*****@host:5433/dbname)

#Read result_set = engine.execute("SELECT * FROM table_name LIMIT 1") for r in result_set: print(r) ``

Any thoughts will be appreciated. Python version: 3.7

Thanks, Victor

bryanherger commented 4 years ago

The pull request adds "vertica" to the dialects with broken commit (_COMMIT_BLACKLIST_DIALECTS) in run.py. You can fix this in your local site-packages by editing the file "run.py" to add "vertica" to the list, then restart your notebook and run again.

ghost commented 4 years ago

Thanks @bryanherger !

It works for me !