get_connection | Teradata Python Package - get_connection - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The get_connection function returns the Vantage connection associated with the current context.

Example

Create a context using username and password.

>>> from teradataml.context.context import *
>>> from teradataml.dataframe.dataframe import DataFrame
>>> create_context(host = "myhostname", username="myusername", password = "mypassword")

Get the connection object.

>>> get_connection()
<sqlalchemy.engine.base.Connection at 0x258d86cd470>