huggingface / dataset-viewer

Lightweight web API for visualizing and exploring any dataset - computer vision, speech, text, and tabular - stored on the Hugging Face Hub
https://huggingface.co/docs/datasets-server
Apache License 2.0
640 stars 65 forks source link

Fix string representation of storage client #2893

Closed albertvillanova closed 3 weeks ago

albertvillanova commented 3 weeks ago

Fix string representation of storage client.

The string representation of the storage client is used by the orchestrator DeleteDatasetStorageTask in both the task id attribute and as a label for prometheus_client Histogram:

Since the inclusion of the URL signer to the storage client by PR:

the string representation of the storage client is something like:

StorageClient(protocol=s3, storage_root=hf-datasets-server-statics-test/assets, base_url=https://datasets-server-test.us.dev.moon.huggingface.tech/assets, overwrite=True), url_signer=<libcommon.cloudfront.CloudFront object at 0x55f27a209110>)

This PR fixes the string representation of the URLSigner to be its class name, and therefore it fixes as well the string representation of the storage client to be something like:

StorageClient(protocol=s3, storage_root=hf-datasets-server-statics-test/assets, base_url=https://datasets-server-test.us.dev.moon.huggingface.tech/assets, overwrite=True), url_signer=CloudFront)