From e9bfb6669998ba3ad4a07a57ad9c1c87df0ea628 Mon Sep 17 00:00:00 2001 From: Hammad Bashir Date: Wed, 1 May 2024 09:43:19 -0700 Subject: [PATCH] [CLN] Add debug for rust storage from config (#2105) ## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Storage from config debug - New functionality - None ## Test plan *How are these changes tested?* - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes None --- rust/worker/src/storage/config.rs | 6 +++--- rust/worker/src/storage/s3.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rust/worker/src/storage/config.rs b/rust/worker/src/storage/config.rs index b8cf4b784f0..8a2477358c7 100644 --- a/rust/worker/src/storage/config.rs +++ b/rust/worker/src/storage/config.rs @@ -1,7 +1,7 @@ use serde::Deserialize; use std::path::Path; -#[derive(Deserialize)] +#[derive(Deserialize, Debug)] /// The configuration for the chosen storage. /// # Options /// - S3: The configuration for the s3 storage. @@ -22,7 +22,7 @@ pub(crate) enum S3CredentialsConfig { AWS, } -#[derive(Deserialize)] +#[derive(Deserialize, Debug)] /// The configuration for the s3 storage type /// # Fields /// - bucket: The name of the bucket to use. @@ -31,7 +31,7 @@ pub(crate) struct S3StorageConfig { pub(crate) credentials: S3CredentialsConfig, } -#[derive(Deserialize)] +#[derive(Deserialize, Debug)] /// The configuration for the local storage type /// # Fields /// - root: The root directory to use for storage. diff --git a/rust/worker/src/storage/s3.rs b/rust/worker/src/storage/s3.rs index 5ab330c2989..76b70af3142 100644 --- a/rust/worker/src/storage/s3.rs +++ b/rust/worker/src/storage/s3.rs @@ -179,6 +179,7 @@ impl ChromaError for StorageConfigError { #[async_trait] impl Configurable for S3Storage { async fn try_from_config(config: &StorageConfig) -> Result> { + println!("Creating storage with config: {:?}", config); match &config { StorageConfig::S3(s3_config) => { let client = match &s3_config.credentials {