or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/gcloud@0.7.x
tile.json

tessl/pypi-gcloud

tessl install tessl/pypi-gcloud@0.7.0

Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub

Agent Success

Agent success rate when using this tile

93%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.19x

Baseline

Agent success rate without this tile

78%

task.mdevals/scenario-5/

Product Inventory Updater

A simple inventory management system that efficiently updates multiple product records in a cloud datastore.

Capabilities

Batch entity updates

The system should update multiple product entities in the datastore efficiently using batch operations. All operations should be committed together as a single batch.

  • Given a list of 3 product updates (ID: "prod-001", name: "Widget A", stock: 100), (ID: "prod-002", name: "Widget B", stock: 50), (ID: "prod-003", name: "Widget C", stock: 75), the system stores all three products in a single batch operation @test

Error handling in batches

When using batch operations, if any error occurs during the batch, none of the changes should be committed to the datastore.

  • Given a batch context that encounters an exception before completion, no entities are committed to the datastore @test

Mixed batch operations

The system should support different types of operations (put, delete) within a single batch.

  • Given 2 new products to add (ID: "prod-010", name: "New Widget", stock: 20), (ID: "prod-011", name: "Another Widget", stock: 30) and 1 existing product to delete (ID: "prod-005"), all operations complete in a single batch @test

Implementation

@generates

API

"""
Inventory updater module for batch datastore operations.
"""

def update_products_batch(client, products):
    """
    Updates multiple products in the datastore using a batch operation.

    Args:
        client: A gcloud datastore Client instance
        products: A list of dictionaries, each containing 'id', 'name', and 'stock'

    Returns:
        None
    """
    pass

def batch_operations_with_delete(client, products_to_add, product_ids_to_delete):
    """
    Performs mixed operations in a single batch: adds new products and deletes existing ones.

    Args:
        client: A gcloud datastore Client instance
        products_to_add: A list of dictionaries, each containing 'id', 'name', and 'stock'
        product_ids_to_delete: A list of product IDs (strings) to delete

    Returns:
        None
    """
    pass

Dependencies { .dependencies }

gcloud { .dependency }

Provides Google Cloud Datastore client library with batch operations support.

@satisfied-by