get_data_source() | FeatureStore Get Method | Teradata Package for Python - get_data_source() - 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

Use the get_data_source() method to retrieve the data source.

Required Parameter

name
Specifies the name of the data source to get.

Example setup

>>> from teradataml import DataFrame, DataSource, FeatureStore, load_example_data

Example: Get the name of the data source

Create DataFrame on admissions data.

>>> load_example_data("dataframe", "admissions_train")
>>> df = DataFrame("admissions_train")
>>> df
   masters   gpa     stats programming  admitted
id
34     yes  3.85  Advanced    Beginner         0
32     yes  3.46  Advanced    Beginner         0
11      no  3.13  Advanced    Advanced         1
40     yes  3.95    Novice    Beginner         0
38     yes  2.65  Advanced    Beginner         1
36      no  3.00  Advanced      Novice         0
7      yes  2.33    Novice      Novice         1
26     yes  3.57  Advanced    Advanced         1
19     yes  1.98  Advanced    Advanced         0
13      no  4.00  Advanced      Novice         1

Create FeatureStore for repo 'vfs_v1'.

>>> fs = FeatureStore("vfs_v1")
Repo vfs_v1 does not exist. Run FeatureStore.setup() to create the repo and setup FeatureStore.

Setup FeatureStore for this repository.

>>> fs.setup()
True

Create DataSource using DataFrame 'df' with name 'admissions'.

>>> ds = DataSource('admissions', source=df)

Apply the DataSource to FeatureStore 'vfs_v1'.

>>> fs.apply(ds)
True

Get the DataSource 'admissions' from repo 'vfs_v1'.

>>> ds = fs.get_data_source('admissions')
>>> ds
DataSource(name=admissions)