RapidCanvas Docs
  • Welcome
  • GETTING STARTED
    • Quick start guide
    • Introduction to RapidCanvas
    • RapidCanvas Concepts
    • Accessing the platform
  • BASIC
    • Projects
      • Projects Overview
        • Creating a project
        • Reviewing the Projects listing page
        • Duplicating a Project
        • Modifying the project settings
        • Deleting Project(s)
        • Configuring global variables at the project level
        • Working on a project
        • Generating the about content for the project
        • Generating AI snippets for each node on the Canvas
        • Marking & Unmarking a Project as Favorite
      • Canvas overview
        • Shortcut options on canvas
        • Queuing the Recipes
        • Bulk Deletion of Canvas Nodes
        • AI Guide
      • Recipes
        • AI-assisted recipe
        • Rapid model recipe
        • Template recipe
        • Code Recipe
        • RAG Recipes
      • Scheduler overview
        • Creating a scheduler
        • Running the scheduler manually
        • Managing schedulers in a project
        • Viewing the schedulers in a project
        • Viewing the run history of a specific scheduler
        • Publishing the updated data pipeline to selected jobs from canvas
        • Fetching the latest data pipeline to a specific scheduler
        • Comparing the canvas of the scheduler with current canvas of the project
      • Predictions
        • Manual Prediction
        • Prediction Scheduler
      • Segments and Scenarios
      • DataApps
        • Model DataApp
        • Project Canvas Datasets
        • Custom Uploaded Datasets
        • SQL Sources
        • Documents and PDFs
        • Prediction Service
        • Scheduler
        • Import DataApp
    • Connectors
      • Importing dataset(s) from the local system
      • Importing Text Files from the Local System
      • Connectors overview
      • Connect to external connectors
        • Importing data from Google Cloud Storage (GCS)
        • Importing data from Amazon S3
        • Importing data from Azure Blob
        • Importing data from Mongo DB
        • Importing data from Snowflake
        • Importing data from MySQL
        • Importing data from Amazon Redshift
        • Importing data from Fivetran connectors
    • Workspaces
      • User roles and permissions
    • Artifacts & Models
      • Adding Artifacts at the Project Level
      • Adding Models at the Project Level
      • Creating an artifact at the workspace level
      • Managing artifacts at the workspace level
      • Managing Models at the Workspace Level
      • Prediction services
    • Environments Overview
      • Creating an environment
      • Editing the environment details
      • Deleting an environment
      • Monitoring the resource utilization in an environment
  • ADVANCED
    • Starter Guide
      • Quick Start
    • Setup and Installation
      • Installing and setting up the SDK
    • Helper Functions
    • Notebook Guide
      • Introduction
      • Create a template
      • Code Snippets
      • DataApps
      • Prediction Service
      • How to
        • How to Authenticate
        • Create a new project
        • Create a Custom Environment
        • Add a dataset
        • Add a recipe to the dataset
        • Manage cloud connection
        • Code recipes
        • Display a template on the UI
        • Create Global Variables
        • Scheduler
        • Create new scenarios
        • Create Template
        • Use a template in a flow notebook
      • Reference Implementations
        • DataApps
        • Artifacts
        • Connectors
        • Feature Store
        • ML model
        • ML Pipeline
        • Multiple Files
      • Sample Projects
        • Model build and predict
  • Additional Reading
    • Release Notes
      • April 21, 2025
      • April 01, 2025
      • Mar 18, 2025
      • Feb 27, 2025
      • Jan 27, 2025
      • Dec 26, 2024
      • Nov 26, 2024
      • Oct 24, 2024
      • Sep 11, 2024
        • Aug 08, 2024
      • Aug 29, 2024
      • July 18, 2024
      • July 03, 2024
      • June 19, 2024
      • May 30, 2024
      • May 15, 2024
      • April 17, 2024
      • Mar 28, 2024
      • Mar 20, 2024
      • Feb 28, 2024
      • Feb 19, 2024
      • Jan 30, 2024
      • Jan 16, 2024
      • Dec 12, 2023
      • Nov 07, 2023
      • Oct 25, 2023
      • Oct 01, 2024
    • Glossary
Powered by GitBook
On this page
  • Prerequisites to add a recipe to the dataset
  • Add another recipe to the dataset
  1. ADVANCED
  2. Notebook Guide
  3. How to

Add a recipe to the dataset

Prerequisites to add a recipe to the dataset

You should create the following:

  • Create a project. See creating a project.

  • Upload a dataset. See, Uploading a dataset to the project.

import sys

from utils.rc.client.requests import Requests
from utils.rc.client.auth import AuthClient

from utils.rc.dtos.project import Project
from utils.rc.dtos.transform import Transform
from utils.rc.dtos.template_v2 import TemplateV2, TemplateTransformV2

import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
Requests.setRootHost("http://staging.dev.rapidcanvas.net/api/")  
AuthClient.setToken(token="")  # you can find your token in RapidCanvas UI under tools/token

Note: If you are launching the Notebook from the UI, you do not have to pass the token.

The below is an example to add a transform/template called, "Add Prefix" to the dataset and run this transform on the dataset to generate the output.

template = TemplateV2.get_template_by('Add Prefix')

recipe_Add_Prefix = project.addRecipe([employee], name='Add Prefix')

transform = Transform()
transform.templateId = template.id
transform.name = 'Add Prefix'
transform.variables = { 
    'input_dataset': 'employee',
    'output_dataset': 'car_prefixed',
    'value_1': "A"
}
recipe_Add_Prefix.add_transform(transform)
recipe_Add_Prefix.run()

Example response:

INFO:Creating new recipe
INFO:Adding new transform
INFO:Transform added Successfully
INFO:Started running
INFO:You can look at the progress on UI at https://test.dev.rapidcanvas.net/#/projects/bd45aabe-891e-4588-9056-0171158e1e44
INFO:No errors and warnings found

Add another recipe to the dataset

You must use the following code to fetch the output dataset of the preceding recipe to use this as an input for another recipe.

car_prefixed = recipe_Add_Prefix.getChildrenDatasets()['car_prefixed']
car_prefixed.getData(10)

Below is an example to run another recipe (Add Suffix) on the output dataset of the prior transform/template.

template = TemplateV2.get_template_by('Add Suffix')

recipe_Add_Suffix = project.addRecipe([car_prefixed], name='Add Suffix')

transform = Transform()
transform.templateId = template.id
transform.name = 'Add Suffix'
transform.variables = { 
    'input_dataset': 'car_prefixed',
    'output_dataset': 'car_suffixed',
    'value_1': "new"
}
recipe_Add_Suffix.add_transform(transform)
recipe_Add_Suffix.run()
PreviousAdd a datasetNextManage cloud connection

Last updated 1 month ago