get_context | Teradata Python Package - 17.00 - get_context - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.00
Release Date
November 2021
Content Type
User Guide
Publication ID
B700-4006-070K
Language
English (United States)

The get_context function returns the Vantage engine associated with the current context.

Example

Create a context using username & password.

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

Get the connection engine.

>>> get_context()
Engine(teradatasql://myusername:***@myhostname)