{"id":6911,"library":"teradataml","title":"TeradataML","description":"teradataml is a Python package that provides an interface to perform advanced analytics on Teradata Vantage. It allows users to leverage the massive parallel processing capabilities of Teradata Vantage for data manipulation, transformation, and various analytic functions without extensive SQL coding. The current version is 20.0.0.10, and it receives frequent minor updates within its major releases.","status":"active","version":"20.0.0.10","language":"en","source_language":"en","source_url":"https://github.com/Teradata/teradataml","tags":["data science","analytics","database","Teradata","Vantage","SQLAlchemy","machine learning"],"install":[{"cmd":"pip install teradataml","lang":"bash","label":"Basic Installation"},{"cmd":"pip install teradataml[automl]","lang":"bash","label":"Install with AutoML dependencies"},{"cmd":"pip install teradataml[openml]","lang":"bash","label":"Install with OpenSourceML dependencies"},{"cmd":"pip install teradataml[visualization]","lang":"bash","label":"Install with Visualization dependencies"},{"cmd":"pip install teradataml[eda-ui]","lang":"bash","label":"Install with EDA UI dependencies"}],"dependencies":[{"reason":"Core dependency for database connectivity, automatically installed.","package":"teradatasqlalchemy","optional":false},{"reason":"Core dependency for database connectivity, automatically installed.","package":"teradatasql","optional":false},{"reason":"Required for AutoML family functions.","package":"imbalanced-learn","optional":true},{"reason":"Required for AutoML and OpenSourceML functions.","package":"scikit-learn","optional":true},{"reason":"Required for OpenSourceML functions.","package":"lightgbm","optional":true},{"reason":"Required for visualization features.","package":"matplotlib","optional":true},{"reason":"Required for visualization features.","package":"seaborn","optional":true},{"reason":"Required for Teradataml EDA UI components.","package":"teradatamlwidgets","optional":true}],"imports":[{"symbol":"create_context","correct":"from teradataml import create_context"},{"symbol":"DataFrame","correct":"from teradataml import DataFrame"},{"symbol":"copy_to_sql","correct":"from teradataml import copy_to_sql"},{"symbol":"remove_context","correct":"from teradataml import remove_context"},{"note":"in_schema is part of the dataframe submodule, not top-level.","wrong":"from teradataml import in_schema","symbol":"in_schema","correct":"from teradataml.dataframe.dataframe import in_schema"}],"quickstart":{"code":"import os\nfrom teradataml import create_context, DataFrame, remove_context\n\nhost = os.environ.get('TD_HOST', 'your_teradata_host')\nusername = os.environ.get('TD_USERNAME', 'your_username')\npassword = os.environ.get('TD_PASSWORD', 'your_password')\ntemp_database_name = os.environ.get('TD_TEMP_DB', 'your_temp_db')\n\n# Establish connection to Teradata Vantage\ntry:\n    create_context(host=host, username=username, password=password, \n                   logmech='TD2', temp_database_name=temp_database_name)\n    print(\"Successfully connected to Teradata Vantage.\")\n\n    # Create a teradataml DataFrame from an existing table\n    # Replace 'your_table_name' and 'your_database' with actual values\n    # For demo, assuming a table named 'sample_data' in the default database\n    td_df = DataFrame(tablename='sample_data')\n    print(\"\\nTeradataml DataFrame head:\")\n    print(td_df.head())\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\nfinally:\n    # Clean up the connection\n    if create_context._active_context:\n        remove_context()\n        print(\"Connection context removed.\")","lang":"python","description":"This quickstart demonstrates how to establish a connection to Teradata Vantage using `create_context`, create a teradataml DataFrame from an existing table, and display its head. It uses environment variables for sensitive connection details."},"warnings":[{"fix":"Manually install required optional dependencies: `pip install teradataml[feature_name]`.","message":"Starting from teradataml 20.0.0.9, optional dependencies are no longer installed by default due to footprint reduction and modularization. Users must explicitly install them using `pip install teradataml[<feature_name>]` (e.g., `teradataml[automl]`, `teradataml[openml]`, `teradataml[visualization]`, `teradataml[eda-ui]`).","severity":"breaking","affected_versions":">=20.0.0.9"},{"fix":"Avoid creating or using table names that begin with digits when using `fastload()`. Consider using `copy_to_sql()` or pandas `to_sql()` instead if this is an issue.","message":"The `fastload()` utility in teradataml does not support table names that start with digits, even though it works with `copy_to_sql()` and SQL directly.","severity":"gotcha","affected_versions":"<20.0.0.10 (fix expected soon)"},{"fix":"Upgrade `teradatasql` (`pip install -U --no-cache-dir teradatasql`) or, for older `teradataml` versions, pass `encryptdata='true'` via a SQLAlchemy engine to `create_context`.","message":"Connections can fail if the Teradata system has 'Require Confidentiality' enabled in `gtwcontrol` due to data encryption issues with older `teradatasql` versions.","severity":"gotcha","affected_versions":"<17.10.00.03 (teradatasql dependency)"},{"fix":"Use `pip install --no-cache-dir -U teradataml` for upgrades.","message":"When upgrading `teradataml`, `pip install` may use a cached version. To ensure the new version is downloaded, use the `--no-cache-dir` option.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update code that relies on the return value of `set_auth_token` to expect the class object, or adjust logic if a boolean check was previously performed.","message":"In version 20.0.0.10, the `set_auth_token` function's return type changed from a boolean to the class object. While functionality remains the same, this might affect code expecting a boolean return.","severity":"breaking","affected_versions":">=20.0.0.10"},{"fix":"Refer to the Teradata Python Package User Guide for updated analytic function names and structures.","message":"In earlier versions (e.g., 16.20.00.01), old analytic functions were deprecated due to namespace changes. While not directly breaking for current versions, users upgrading from very old `teradataml` might encounter this.","severity":"deprecated","affected_versions":"<16.20.00.02 (deprecated in 16.20.00.01, removed in future release)"},{"fix":"Use `sqlalchemy.create_engine('teradatasql://...')` for creating the engine.","message":"When creating a SQLAlchemy engine for use with `teradataml`'s `create_context`, ensure to specify the `teradatasql` dialect, not a generic `teradata` dialect, to avoid `NoSuchModuleError`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}