vmware-archive / sql_magic

Magic functions for using Jupyter Notebook with Apache Spark and a variety of SQL databases.
Apache License 2.0
172 stars 21 forks source link

Syntax highlighting does not work in Jupyterlab #6

Open dylancsumner opened 6 years ago

dylancsumner commented 6 years ago

As it says in the title.

scottcode commented 6 years ago

Thanks @dylancsumner for reporting this. Which version of Jupyterlab are you using? Any ideas why it might not be working? Pull requests are welcome.

brbarkley commented 6 years ago

Also have same problem. I have Jupyterlab 0.31.11 with Anaconda Python 3.6. Notebook extensions are also not necessarily compatible with Jupyterlab. See [https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1258]

brbarkley commented 6 years ago

Also see here

crawles commented 6 years ago

Thanks @brbarkley. It looks like we will have to explore new options for Jupyterlab

rd5802 commented 6 years ago

Hi,

In JupyterLab I`m running the following code:

from sqlalchemy import create_engine oracle = create_engine('oracle://user:pass!!@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1521))(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=blobdb)))')

%reload_ext sql_magic %config SQL.conn_name = 'oracle' ` /opt/jhub/env/lib64/python3.6/site-packages/psycopg2/init.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: http://initd.org/psycopg/docs/install.html#binary-install-from-pypi. """)`

JavaScript output is disabled in JupyterLab

%%read_sql df_result SELECT * from (SELECT * from table) WHERE ROWNUM < 10

Here I get query result.

There is not sql syntax hightlihting and no browser notification is displayed.

Is it some kind of issue or JupyterLab isn`t supported? Do you plan to support JupyterLab?

Regards, RD

crawles commented 6 years ago

The key issue is JavaScript output is disabled in JupyterLab. Will try to look into it more. Other extensions are having this issue: https://github.com/jupyterlab/jupyterlab/issues/3748 , even Matplotlib, at least in August, https://github.com/jupyterlab/jupyterlab/issues/2948. Will need to figure out if they fixed it/how

rd5802 commented 6 years ago

Hi,

Hope youll work this out. Its a great extension worth developing. JupyterLab lacks functionalities of sql development client (eg. SQL Developer) like database objects browser, intellisense, sql templates....

Making it would be a hot shot.

Regards,

RD

rd5802 commented 6 years ago

Hi, Just wanted to know of you are planning to rework extension fot JupyterLab

crawles commented 6 years ago

Will likely not look to add this until a clear solution in JupyterLab exists. The original issue ( https://github.com/jupyterlab/jupyterlab/issues/3869) to support sql coloring for JupyterLab is still open

On Wed, Jul 4, 2018 at 10:06 PM rd5802 notifications@github.com wrote:

Hi, Just wanted to know of you are planning to rework extension fot JupyterLab

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pivotal-legacy/sql_magic/issues/6#issuecomment-402551945, or mute the thread https://github.com/notifications/unsubscribe-auth/AE2vSRPro16tdgvL12CPSYhaXt0G8FwKks5uDSA6gaJpZM4SVLeK .

-- Chris