tessl install tessl/pypi-azure-storage-file-datalake@12.21.0Microsoft 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%
Build a metadata management utility for Azure Data Lake Storage Gen2 that allows users to track and organize files using custom metadata tags.
Your implementation should provide the following functionality:
Create a utility that can:
@generates
class FileMetadataManager:
"""
Manages custom metadata for files in Azure Data Lake Storage Gen2.
"""
def __init__(self, account_url: str, file_system_name: str, credential):
"""
Initialize the metadata manager.
Args:
account_url: The URL to the Data Lake Storage account (e.g., https://<account>.dfs.core.windows.net)
file_system_name: The name of the file system (container) to work with
credential: Authentication credential (can be account key, SAS token, or Azure AD credential)
"""
pass
def add_metadata(self, file_path: str, metadata: dict) -> None:
"""
Add custom metadata to a file.
Args:
file_path: Path to the file within the file system
metadata: Dictionary of metadata key-value pairs to add
"""
pass
def get_metadata(self, file_path: str) -> dict:
"""
Retrieve all metadata associated with a file.
Args:
file_path: Path to the file within the file system
Returns:
Dictionary containing all metadata key-value pairs
"""
pass
def update_metadata(self, file_path: str, metadata: dict) -> None:
"""
Update metadata on a file, replacing existing metadata.
Args:
file_path: Path to the file within the file system
metadata: Dictionary of new metadata key-value pairs
"""
pass
def has_metadata_key(self, file_path: str, key: str) -> bool:
"""
Check if a file has a specific metadata key.
Args:
file_path: Path to the file within the file system
key: The metadata key to check for
Returns:
True if the key exists in the file's metadata, False otherwise
"""
passProvides Azure Data Lake Storage Gen2 client library for Python.
@satisfied-by