CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-connectorx

Load data from databases to dataframes, the fastest way.

86

1.04x

Quality

Pending

Does it follow best practices?

Impact

86%

1.04x

Average score across 10 eval scenarios

Overview
Eval results
Files

task.mdevals/scenario-8/

Database Type Inspector

A utility that loads data from a database and analyzes how different database types are converted to Python dataframe types.

Capabilities

Inspect dataframe types after loading

  • Given connection string "sqlite:///:memory:" and query "SELECT 1 as id, 'test' as name", calling inspect_types returns {"id": "Int64", "name": "object"} @test
  • Given a table with nullable integer column (values: 1, 2, NULL), the resulting pandas dataframe uses Int64 nullable type instead of float64 @test
  • Given a table with boolean column (values: true, false, NULL), the resulting pandas dataframe preserves boolean type with proper null handling @test

Compare type mappings across formats

  • Given the same query loaded into pandas and arrow formats, compare_format_types returns different type representations for each format (e.g., pandas uses "Int64" while arrow uses "int64") @test

Implementation

@generates

API

def inspect_types(conn_str: str, query: str) -> dict[str, str]:
    """
    Load data from a database and return a mapping of column names to their
    Python dataframe data types.

    Args:
        conn_str: Database connection string
        query: SQL query to execute

    Returns:
        Dictionary mapping column names to type names (as strings)
    """
    pass

def compare_format_types(conn_str: str, query: str) -> dict[str, dict[str, str]]:
    """
    Load the same data into both pandas and arrow formats and return
    type information for each format.

    Args:
        conn_str: Database connection string
        query: SQL query to execute

    Returns:
        Dictionary with keys 'pandas' and 'arrow', each containing a
        dictionary mapping column names to type names (as strings)
    """
    pass

Dependencies { .dependencies }

connectorx { .dependency }

Provides high-performance data loading from databases with sophisticated type mapping.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-connectorx

tile.json