DataFrames Become Invalid When a Connection Context is Recreated - Teradata Python Package

Teradata® Python Package User Guide

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-29
dita:mapPath
rkb1531260709148.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

On recreating a connection context using the create_context command, most of the operations on the DataFrames created using an earlier connection context fail.

The users receive a warning when the create_context command is rerun.

For example:

>>> create_context(host = "myhostname", username="myusername", password = "mypassword")
>>> df = DataFrame('table1')
 
>>> create_context(host = "myhostname", username="myusername", password = "mypassword")
UserWarning: [Teradata][teradataml](TDML_2002) Overwriting an existing context associated with Teradata connection. Most of the operations on any teradataml DataFrames created before this will not work.
 
 
>>> df.select(['model','phrase_id'])
TeradataMlException: [Teradata][teradataml](TDML_2103) Internal Error: Non-zero status returned from AED.

To work around this limitation, recreate the DataFrames with the new connection context.

For example, recreate the 'df' DataFrame after the new connection context is created in the above example.

>>> df = DataFrame('table1')
>>> df.select(['model','phrase_id'])
      phrase_id
model         
1             1
1             2
1             2
1             1
1             1
1             1
(6, 3)