Teradata Python Package Import - 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

Importing Teradata Package for Python modules using wildcard '*' or specific modules can lead to namespace collisions which overwrites the variable names used.

Example:

>>> import pandas as pd
>>> data = pd.read_csv(r"./sample.csv")
>>> print(type(data))
 
<class 'pandas.core.frame.DataFrame'>
 
 
>>> from teradataml import *
>>> print(type(data))
 
<class 'module'>

'data' is one of the module names in Teradata Package for Python and local variable 'data' which holds csv data is replaced by the module object.

To avoid the overwriting issue:
  • Avoid wildcard imports: Instead of using 'from package import *', explicitly import only the necessary components. For example:
    >>> from teradataml  import specific_module
  • Use aliases: If you need to import a module with a common name, use an alias to avoid conflicts. For example:
    >>> import teradataml.data as td_data