There are two main ways to preview transforms in local development with VS Code:
The Palantir extension for Visual Studio Code supports local preview functionality. Refer to the extension documentation for installation instructions. Once the extension has been installed and the environment is ready for preview, your transforms should be automatically discovered in the Preview tab as shown below.
Running Python Transforms Preview is possible with two backends: remote
and local
. The former runs the previewed code inside of Foundry so that no data (except the results) get sent to the user's machine. However, when running preview in local
mode, parts of the datasets are downloaded to the user's machine. For more information, consult the Transforms preview page of the VS Code extension.
This section details the steps required to preview Python and Java transforms in local development. For additional context, review our documentation for Java local development. You can also learn more about how to preview transforms. Gradle-based local preview executes the preview remotely, inside of Foundry.
Local preview support requires that the local branch must be tracking a remote branch such that the local branch needs to be pushed at least once, on top of existing prerequisites for local development. Note the following additional limitations:
Before running the preview, you must set up the environment for local development and ensure that your repository is upgraded to the latest template version.
Run ./gradlew displayTransformsList
which will return a list of all available transforms.
Run ./gradlew datasetPreview --transformId=<transformId>
with <transformId>
replaced by one of the transform ids (blue text on the screenshot above), which will return a link to Foundry where the already-computed preview can be accessed.
(Optional) Add --printMode=table
flag to the command above to print the first 10 rows of all previewed datasets directly in your terminal instead of being provided a link to the preview.
(Optional) To include input files in the preview, add --inputFiles=<datasetAlias>:<path>
where <datasetAlias>
is one of the input datasets from the selected transform function and <path>
is the file path within the input dataset.
(Optional) To include output files in the preview, add --outputFiles=<datasetAlias>:<path>
where <datasetAlias>
is one of the output datasets from the selected transform function and <path>
is the file path within the output dataset.