qlty_missingValues
Identify columns containing missing values in Teradata database tables to assess data quality and completeness for analysis.
Instructions
Get the column names that having missing values in a table.
Arguments: database_name - name of the database table_name - table name to analyze
Returns: ResponseType: formatted response with query results + metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_name | Yes | ||
| table_name | Yes |
Implementation Reference
- The main handler function that implements the qlty_missingValues tool. It executes a Teradata query using TD_ColumnSummary to retrieve columns with missing values (NullCount and NullPercentage), formats the results, and returns a response with metadata.def handle_qlty_missingValues(conn: TeradataConnection, database_name: str | None, table_name: str, *args, **kwargs): """ Get the column names that having missing values in a table. Arguments: database_name - name of the database table_name - table name to analyze Returns: ResponseType: formatted response with query results + metadata """ logger.debug(f"Tool: handle_qlty_missingValues: Args: table_name: {database_name}.{table_name}") if database_name is not None: table_name = f"{database_name}.{table_name}" with conn.cursor() as cur: rows = cur.execute(f"select ColumnName, NullCount, NullPercentage from TD_ColumnSummary ( on {table_name} as InputTable using TargetColumns ('[:]')) as dt ORDER BY NullCount desc") data = rows_to_json(cur.description, rows.fetchall()) metadata = { "tool_name": "qlty_missingValues", "database_name": database_name, "table_name": table_name, "rows": len(data) } logger.debug(f"Tool: handle_qlty_missingValues: Metadata: {metadata}") return create_response(data, metadata)