or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-storage-file-datalake@12.21.x
tile.json

tessl/pypi-azure-storage-file-datalake

tessl install tessl/pypi-azure-storage-file-datalake@12.21.0

Microsoft Azure File DataLake Storage Client Library for Python

Agent Success

Agent success rate when using this tile

92%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.99x

Baseline

Agent success rate without this tile

93%

task.mdevals/scenario-8/

DataLake File System Organizer

A utility for organizing and restructuring files and directories in Azure DataLake Storage Gen2 by renaming them according to new naming conventions.

Capabilities

Renames directories

  • Given an existing directory "old-reports", the organizer renames it to "reports-2024" @test
  • When renaming a directory that does not exist, it handles the error gracefully @test

Renames files

  • Given an existing file "data.csv", the organizer renames it to "archived-data.csv" @test
  • When renaming a file that does not exist, it handles the error gracefully @test

Moves files across directories

  • Given a file "logs/app.log", the organizer moves it to "archive/logs/app-2024.log" by providing the full new path @test

Implementation

@generates

The organizer should provide functions to:

  • Rename directories in a file system
  • Rename files in a file system (which can also move files by specifying a different directory in the new path)

All operations should:

  • Accept the file system name, current path, and new path
  • Return the new path on success
  • Handle errors appropriately (e.g., resource not found)

API

def rename_directory(file_system_name: str, current_path: str, new_path: str,
                    account_url: str, credential) -> str:
    """
    Renames a directory in Azure DataLake Storage Gen2.

    Args:
        file_system_name: Name of the file system containing the directory
        current_path: Current path of the directory to rename
        new_path: New path for the directory
        account_url: Azure Storage account URL
        credential: Azure credential for authentication

    Returns:
        The new path of the renamed directory

    Raises:
        Exception: If the directory does not exist or operation fails
    """
    pass


def rename_file(file_system_name: str, current_path: str, new_path: str,
               account_url: str, credential) -> str:
    """
    Renames or moves a file in Azure DataLake Storage Gen2.
    Can move files between directories by specifying a different directory in new_path.

    Args:
        file_system_name: Name of the file system containing the file
        current_path: Current path of the file to rename
        new_path: New path for the file (can be in a different directory)
        account_url: Azure Storage account URL
        credential: Azure credential for authentication

    Returns:
        The new path of the renamed file

    Raises:
        Exception: If the file does not exist or operation fails
    """
    pass

Dependencies { .dependencies }

azure-storage-file-datalake { .dependency }

Provides Azure DataLake Storage Gen2 client library for file system operations.