remove_context | Teradata Python Package - remove_context - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
March 2024
Language
English (United States)
Last Update
2024-04-09
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

The remove_context function removes the current context associated with the Vantage connection.

remove_context() not only closes the connection but also garbage collects the intermediate views and tables created by teradataml.

Teradata recommends calling remove_context() to end a session, so that intermediate views and tables created by teradataml are garbage collected.

Executing remove_context() triggers garbage collection in teradataml. See Garbage Collection in teradataml for more details.

Example

>>> from teradataml.context.context import *
>>> from teradataml.dataframe.dataframe import DataFrame
>>> td_connection = create_context(host = "myhostname", username="myusername", password = "mypassword")
>>> get_context()
Engine(teradatasql://myusername:***@myhostname)

>>> remove_context()
True

>>> get_context()