Add a dataset

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.dataset import Dataset
from utils.rc.dtos.dataset import FileType
from utils.rc.dtos.recipe import Recipe
from utils.rc.dtos.transform import Transform
from utils.rc.dtos.project_run import ProjectRun
from utils.rc.dtos.dataSource import DataSource
from utils.rc.dtos.dataSource import DataSourceType
from utils.rc.dtos.dataSource import S3Config
from utils.rc.dtos.dataSource import RedisStorageConfig

from utils.rc.dtos.template_v2 import TemplateV2, TemplateTransformV2

import os
import pandas as pd
import logging
from utils.utils.log_util import LogUtil
LogUtil.set_basic_config(format='%(levelname)s:%(message)s', level=logging.INFO)

Use this code block to add a dataset.

datasetname = project.addDataset(
    dataset_name="datasetname",
    dataset_description="description for the dataset",
    dataset_file_path="file path"
)
datasetname.id

Sample code:

titanic = project.addDataset(
    dataset_name="titanic",
    dataset_description="titanic golden",
    dataset_file_path="data/titanic.csv"
)
titanic.id
INFO:Creating new dataset by name:transaction1
INFO:Uploading file data/titanic.csv ....
INFO:Uploading Done
'2d030261-2dbf-4a4d-8f9f-b82c226faa57'

The following table describes about each parameter in the add dataset code block:

Parameter:

Description

dataset_name:

The name of the dataset.

dataset_description:

The description for the dataset.

dataset_file_path:

The path where the dataset is located.

datasetname.id:

The id generated for the dataset after it is created.