skip to Main Content

I am trying to use Visual Studio Code for Spark development.

My PySpark code all runs fine, but there is no code completion/hints.

How can I add these features for VS Code?

I have the Python and Pylance extensions installed.

In PyCharm this all work perfectly as expected.

2

Answers


  1. Chosen as BEST ANSWER

    The solution I found was to use the Jedi language server:-

    "python.languageServer": "Jedi"

    For Jupyter notebook you also need to set:-

    "jupyter.enableExtendedPythonKernelCompletions": true


  2. As mentioned in doc, you need to install and set up the Databricks extension for Visual Studio Code.

    To enable IntelliSense (also known as code completion) in the Visual Studio Code code editor for PySpark, Databricks Utilities, and related globals such as spark and dbutils, do the following with your code project opened:

    1. On the Command Palette (View > Command Palette), type >Databricks:
      Configure autocomplete for Databricks globals
      and press Enter.
    2. Follow the on-screen prompts to allow the Databricks extension for
      Visual Studio Code to install PySpark for your project, and to add
      or modify the __builtins__.pyi file for your project to enable
      Databricks Utilities.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search