or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-data-tables@12.7.x
tile.json

tessl/pypi-azure-data-tables

tessl install tessl/pypi-azure-data-tables@12.7.0

Microsoft Azure Data Tables Client Library for Python

Agent Success

Agent success rate when using this tile

90%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.97x

Baseline

Agent success rate without this tile

93%

task.mdevals/scenario-2/

Customer Data Export Tool

A tool that retrieves customer records from Azure Table Storage and exports them with selective field projection to minimize bandwidth usage and improve performance.

Background

Your company stores customer records in Azure Table Storage with comprehensive information about each customer. However, different reports require different subsets of customer data. The marketing team needs contact information, the analytics team needs behavioral data, and the finance team needs transaction summaries. Loading all fields for every query wastes bandwidth and slows down processing.

Task

Build a customer data export tool that retrieves entities from Azure Table Storage with selective field projection. The tool should allow users to specify which fields they want to retrieve, and only those fields should be returned from the service.

Requirements

Core Functionality

  1. Connection Management: Connect to Azure Table Storage using a connection string provided via environment variable AZURE_TABLES_CONNECTION_STRING.

  2. Selective Field Retrieval: Implement a function that retrieves customer entities with only the specified fields. The function should:

    • Accept a table name
    • Accept a list of field names to retrieve
    • Return entities containing only the requested fields (plus PartitionKey and RowKey which are always included)
  3. Query with Projection: Implement a function that queries entities matching specific criteria while retrieving only specified fields. The function should:

    • Accept a table name
    • Accept a filter expression
    • Accept a list of field names to retrieve
    • Return matching entities with only the requested fields
  4. Bandwidth Efficiency: The tool must use property projection at the API level (not filtering in code after retrieval) to reduce data transfer.

Test Cases

  • Given a table with entities containing fields (PartitionKey, RowKey, Name, Email, Phone, Address, Age, City), when listing all entities with select=['Name', 'Email'], the returned entities should only contain PartitionKey, RowKey, Name, and Email fields @test

  • Given a table with customer entities, when querying with filter "Age gt 25" and select=['Name', 'City'], only entities matching the filter should be returned and each should only contain PartitionKey, RowKey, Name, and City fields @test

  • Given a table with entities, when retrieving entities with select=['Email'] and one entity has no Email field, that entity should be returned with only PartitionKey and RowKey @test

@generates

API

from typing import List, Dict, Any, Iterator

def get_table_client(table_name: str):
    """
    Creates and returns a TableClient for the specified table.
    Uses AZURE_TABLES_CONNECTION_STRING environment variable.

    Args:
        table_name: Name of the table

    Returns:
        TableClient instance
    """
    pass

def list_entities_with_projection(table_name: str, select_fields: List[str]) -> Iterator[Dict[str, Any]]:
    """
    Retrieves all entities from a table with only specified fields.

    Args:
        table_name: Name of the table
        select_fields: List of field names to retrieve

    Returns:
        Iterator of entity dictionaries containing only selected fields
        (plus PartitionKey and RowKey which are always included)
    """
    pass

def query_entities_with_projection(table_name: str, filter_query: str, select_fields: List[str]) -> Iterator[Dict[str, Any]]:
    """
    Queries entities matching a filter with only specified fields.

    Args:
        table_name: Name of the table
        filter_query: OData filter expression
        select_fields: List of field names to retrieve

    Returns:
        Iterator of entity dictionaries matching the filter,
        containing only selected fields (plus PartitionKey and RowKey)
    """
    pass

Dependencies { .dependencies }

azure-data-tables { .dependency }

Provides Azure Table Storage client functionality including entity querying with property projection support.

@satisfied-by