2. [Repositories] Introduction to Data Transformations5. Your First Identity Transform

5 - Your First (“Identity”) Transform

This content is also available at learn.palantir.com ↗ and is presented here for accessibility purposes.

📖 Task Introduction

In this exercise, you’ll create a simple "identity transform" ↗ to output a version of the three raw datasets referenced in the tutorial introduction into your datasource project.

Recall that this step is needed only because you are not creating this raw dataset from an actual externally connected source. In a production scenario, the data connection would have been configured to output the synchronized table to ../datasets/raw/ in your project.

🔨 Task Instructions

  1. The left side of your flight_alerts_logic code repository contains a collapsed list of all of its files. Mouse over the /transforms-python folder in the Files section and click the ... that appears to the right. Then choose Expand all.
  2. Right click on the /datasets folder and choose New folder. In the window that appears, type "raw" into the New name field and then click the blue Create button in the bottom right. The Files section now highlights the folder paths that contain uncommitted changes. Your new /raw folder is automatically provisioned with an __init__.py file ↗.
  3. Right click on your new /raw folder and choose New file.
  4. In the New name field, type flight_alerts_raw.py and then click Create. Your code editor window provides you with the basic structure of a data transform, including a suggested output path and a placeholder for you to define your input dataset.
  5. Replace “SOURCE_DATASET_PATH” with the path to the raw dataset input provided in your Foundry environment: "/{$}/Foundry Training and Resources/Example Projects/[Datasource] Flight Alerts/datasets/raw/flight_alerts_raw".
  6. Your Foundry administrator has configured a space that contains the Foundry Training and Resources project and that consequently appears as the root for all project file paths. When you created your flight_alerts_raw.py file, Foundry added the space in the Output filepath on line 6 of your transform.

Replace the {$} from step 5 with that same space. In the image below, the space is called /Public, but bear in mind it may be different at your organization.

As your output will not be in the Foundry Training and Resources project, you’ll notice your Input line is underlined in red, indicating an error. To fix the issue, you’ll need to take an additional step of making a Project Reference using the process illustrated here.