qlty_rowsWithMissingValues
Identify and retrieve rows containing missing values in a specified Teradata table column to assess data quality and integrity.
Instructions
Get the rows with missing values in a table.
Arguments: database_name - name of the database table_name - table name to analyze column_name - column 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 | ||
| column_name | Yes |
Implementation Reference
- Handler function executing the qlty_rowsWithMissingValues tool. It connects to Teradata, constructs the table reference, executes a query using TD_getRowsWithMissingValues to fetch rows with missing values in the specified column, formats the results, and returns a response with metadata.def handle_qlty_rowsWithMissingValues( conn: TeradataConnection, database_name: str | None, table_name: str, column_name: str, *args, **kwargs ): """ Get the rows with missing values in a table. Arguments: database_name - name of the database table_name - table name to analyze column_name - column name to analyze Returns: ResponseType: formatted response with query results + metadata """ logger.debug(f"Tool: handle_qlty_rowsWithMissingValues: Args: table_name: {database_name}.{table_name}, column_name: {column_name}") if database_name is not None: table_name = f"{database_name}.{table_name}" with conn.cursor() as cur: rows = cur.execute(f"select * from TD_getRowsWithMissingValues ( ON {table_name} AS InputTable USING TargetColumns ('[{column_name}]')) AS dt;") data = rows_to_json(cur.description, rows.fetchall()) metadata = { "tool_name": "qlty_rowsWithMissingValues", "database_name": database_name, "table_name": table_name, "column_name": column_name, "rows_with_missing_values": len(data) } logger.debug(f"Tool: handle_qlty_rowsWithMissingValues: Metadata: {metadata}") return create_response(data, metadata)