DataFrame Creation on Volatile Tables not Supported | Teradata Python Package - DataFrame Creation on Volatile Tables is not Supported - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2022-01-14
dita:mapPath
bol1585763678431.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

DataFrame creation on volatile tables is not supported, an error raises.

>>> load_example_data("sessionize", "sessionize_table")
>>> df3 = DataFrame('sessionize_table')
>>> # Create a Volatile table using copy_to_sql
>>> copy_to_sql(df3, "test_copyto_volatile", temporary=True)
>>> DataFrame("test_copyto_volatile")
Traceback (most recent call last):
  File "/Users/pp186043/Github_Repos/teradataml_repo/pyTeradata/teradataml/dataframe/dataframe.py", line 163, in __init__
    self._metaexpr = self._get_metaexpr()
  File "/Users/pp186043/Github_Repos/teradataml_repo/pyTeradata/teradataml/dataframe/dataframe.py", line 394, in _get_metaexpr
    t = sqlalchemy.Table(db_table_name, meta, schema=db_schema, autoload=True, autoload_with=eng)
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 470, in __new__
    metadata._remove_table(name, schema)
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 67, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 277, in reraise
    raise value
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 465, in __new__
    table._init(name, metadata, *args, **kw)
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 548, in _init
    metadata, autoload_with, include_columns, _extend_on=_extend_on
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 570, in _autoload
    _extend_on=_extend_on,
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2118, in run_callable
    return conn.run_callable(callable_, *args, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1590, in run_callable
    return callable_(self, *args, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 415, in reflecttable
    table, include_columns, exclude_columns, **opts
  File "/anaconda3/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 643, in reflecttable
    raise exc.NoSuchTableError(table.name)
sqlalchemy.exc.NoSuchTableError: test_copyto_volatile
 
The above exception was the direct cause of the following exception:
 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pp186043/Github_Repos/teradataml_repo/pyTeradata/teradataml/dataframe/dataframe.py", line 171, in __init__
    raise TeradataMlException(Messages.get_message(MessageCodes.TDMLDF_CREATE_FAIL), MessageCodes.TDMLDF_CREATE_FAIL) from err
teradataml.common.exceptions.TeradataMlException: [Teradata][teradataml](TDML_2010) Failed to create Teradata DataFrame.