Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide completions only within a SQL context #111

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

rschroll
Copy link
Contributor

Describe your changes

If we're in a SQL magic cell, or to the right of a line magic, provide SQL completions. Otherwise, don't.

Issue number

Closes #6

Checklist before requesting a review

Specifically, offer completions if the cell begins with %%sql or
we're to the right of %sql on this line.  Note that this will have
some false positives (if there's a string that contains '%sql'),
but this should work in 99% of the cases.
@edublancas
Copy link
Contributor

hi @rschroll, thanks so much for contributing to this! this is still marked as a draft, let me know once it's ready for review!

@rschroll rschroll marked this pull request as ready for review March 25, 2024 19:52
@rschroll
Copy link
Contributor Author

Two things perhaps blocking review:

  1. Tests haven't run yet. (I generally refuse to do code review unless tests are passing; not sure if you're the same.)
  2. I haven't made any documentation or changelog updates. Re the changelog, I wasn't sure if I should add a new version entry for the new items or not.

@edublancas
Copy link
Contributor

@neelasha23 please test this to ensure it works

@rschroll

Tests haven't run yet. (I generally refuse to do code review unless tests are passing; not sure if you're the same.)

yep, we do the same (review until tests pass) but if contributors run into issues getting them to pass we also help!

I haven't made any documentation or changelog updates. Re the changelog, I wasn't sure if I should add a new version entry for the new items or not.

yes, please create a new version and add an item for the changes

@neelasha23
Copy link
Contributor

I haven't been able to build this locally (and I'm facing similar issue with the master branch). There is some error in validating the plugin:

(jupysql-completion) neelashasen@192 jupysql-plugin % jupyter labextension list                     
JupyterLab v4.1.5
/Users/neelashasen/miniforge3/envs/jupysql-completion/share/jupyter/labextensions
        jupyterlab-jupytext v1.4.2 enabled OK (python, jupytext)
        ploomber-extension v0.1.0 enabled OK (python, ploomber_extension)
        jupysql-plugin v0.4.2 enabled  X (python, jupysql-plugin)
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v5.0.10 enabled OK (python, jupyterlab_widgets)


   The following extensions are outdated:
        jupysql-plugin
        
   Consider checking if an update is available for these packages.

(jupysql-completion) neelashasen@192 jupysql-plugin % jupyter labextension enable jupysql_plugin
(jupysql-completion) neelashasen@192 jupysql-plugin % jupyter server extension list
Config dir: /Users/neelashasen/.jupyter

Config dir: /Users/neelashasen/miniforge3/envs/jupysql-completion/etc/jupyter
    jupysql_plugin enabled
    - Validating jupysql_plugin...
       X validation failed
    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 2.2.4 OK
    jupyter_server_terminals enabled
    - Validating jupyter_server_terminals...
      jupyter_server_terminals 0.5.3 OK
    jupyterlab enabled
    - Validating jupyterlab...

I have added manually as well by running

jupyter labextension list
jupyter server extension list

I have run git clean -fdx and created clean environments multiple times but I see the error everytime. Still trying to get this work @edublancas

@edublancas edublancas merged commit 55bdc17 into ploomber:main Mar 29, 2024
7 checks passed
@edublancas
Copy link
Contributor

thanks @rschroll, making a release now!

@xofbd xofbd deleted the completion-context branch May 22, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only autocomplete when cell starts with %%sql
3 participants