DataSource Class | Teradata Package for Python - DataSource Class - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Package for Python
Release Number
20.00
Published
March 2025
ft:locale
en-US
ft:lastEdition
2025-12-05
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

The DataSource class represents a data source that provides data for features.

Syntax

DataSource(name, source, description=None, timestamp_column=None)

Required Parameters

name
Specifies unique name of the data source.
source
Specifies the source query of DataSource.

Optional Parameters

description
Specifies the human readable description of the data source.
timestamp_column
Specifies the timestamp column indicating when the row was created.

Example setup

>>> load_example_data('dataframe', ['sales'])
>>> df = DataFrame("sales")

Example 1: Create a DataSource for above mentioned DataFrame with name 'Sales_Data'

>>> from teradataml import DataSource
>>> data_source = DataSource('Sales_Data', df)
>>> data_source
DataSource(Sales_Data)

Example 2: Create a DataSource with source query

>>> data_source = DataSource('Sales_Data_Query', source="SELECT * FROM sales")
>>> data_source
DataSource(Sales_Data_Query)