Transforms preview

The Palantir extension for Visual Studio Code allows you to preview Python transforms directly from your local Visual Studio Code environment or a VS Code Workspace in the Palantir platform. This capability enables rapid testing of transforms without the need to exit the code editor. Currently, this feature is only available for Python transforms.

Initiate a preview

You can start a preview within your local Visual Studio Code environment or an in-platform VS Code Workspace in the following four ways:

  • Select the Run preview command from the Command Palette.

Find the "Run  preview" command in the Command Palette.

  • Select the Run preview icon from the toolbar.

The "Run preview" icon, which is a fast-forward symbol, from the VS Code toolbar.

  • Select Preview above the transform.

The "Preview" option above an example Python transform.

  • Open the Preview panel and select the Preview button next to the code filename.

The "Preview" button in the VS Code "Preview" panel.

Preview process

The extension provides two methods for previewing transforms:

1. Remote preview with a Code Assist workspace (local use of Palantir extension only)

Using Palantir Code Assist with the Palantir extension is the standard method for previewing during local development.

Upon cloning a Python transforms repository and opening a Python file, the Palantir extension will establish a connection to a remote Code Assist workspace, just as it would for an in-platform code repository environment.

A Code Assist workspace setting up in a local VS Code environment.

Once Code Assist is ready, the extension will identify all transforms present in the open files.

After selecting a transform for preview, the preview will execute on the remote Code Assist workspace.

2. Local preview

Using a local preview is the default previewing method for users working within a in-platform VS Code Workspace.

For local development, local preview must be enabled by your platform administrator.

Upon opening a Palantir repository, the extension will configure the environment. Once the environment is set up and transforms are detected, you will be able to execute previews locally. To do this, the extension downloads and temporarily stores portions of datasets to your machine as long as you have the appropriate permissions for the data.