create_context(host=None, username=None, password=None, tdsqlengine=None, temp_database_name=None, logmech=None)
DESCRIPTION:
Creates a connection to the Teradata Vantage using the teradatasql + teradatasqlalchemy DBAPI and dialect combination.
Users can pass all required parameters (host, username, password) for establishing a connection to Vantage,
or pass a sqlalchemy engine to the tdsqlengine parameter to override the default DBAPI and dialect combination.
PARAMETERS:
host:
Optional Argument.
Specifies the fully qualified domain name or IP address of the Teradata System.
Types: str
username:
Optional Argument.
Specifies the username for logging onto the Teradata Vantage.
Types: str
password:
Optional Argument.
Specifies the password required for the username.
Types: str
tdsqlengine:
Optional Argument.
Specifies Teradata Vantage sqlalchemy engine object that should be used to establish a Teradata Vantage connection.
Types: str
temp_database_name:
Optional Argument.
Specifies the temporary database name where temporary tables, views will be created.
Types: str
***logmech:
Optional Argument.
Specifies the type of logon mechanism to establish a connection to Teradata Vantage.***
***Permitted Values: 'TD2', 'TDNEGO', 'LDAP' & 'KRB5'.***
***Types: str***
RETURNS:
A Teradata sqlalchemy engine object.
RAISES:
TeradataMlException
Example for using LDAP server:
con = create_context(host = 'ldap server', username='ldapuser', password = 'ldappassword', logmech='LDAP')