Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketkedia committed Nov 13, 2024
1 parent d81c946 commit 1e1e6be
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion rust/blockstore/src/arrow/blockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ impl<'me, K: ArrowReadableKey<'me> + Into<KeyWrapper>, V: ArrowReadableValue<'me

result.extend(block.get_all_data());
}
return result;
result
}
}

Expand Down
4 changes: 2 additions & 2 deletions rust/blockstore/src/memory/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,11 @@ impl Writeable for &DataRecord<'_> {
}

impl Writeable for &SpannPostingList<'_> {
fn write_to_storage(prefix: &str, key: KeyWrapper, value: Self, storage: &StorageBuilder) {
fn write_to_storage(_: &str, _: KeyWrapper, _: Self, _: &StorageBuilder) {
todo!()
}

fn remove_from_storage(prefix: &str, key: KeyWrapper, storage: &StorageBuilder) {
fn remove_from_storage(_: &str, _: KeyWrapper, _: &StorageBuilder) {
todo!()
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/blockstore/src/types/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl<

pub async fn get_all_data(&'referred_data self) -> Vec<(&'referred_data str, K, V)> {
match self {
BlockfileReader::MemoryBlockfileReader(reader) => todo!(),
BlockfileReader::MemoryBlockfileReader(_) => todo!(),
BlockfileReader::ArrowBlockfileReader(reader) => reader.get_all_data().await,
}
}
Expand Down
1 change: 0 additions & 1 deletion rust/index/src/hnsw.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use super::{Index, IndexConfig, IndexUuid, PersistentIndex};
use chroma_error::{ChromaError, ErrorCodes};
use chroma_types::MetadataValueConversionError;
use std::ffi::CString;
use std::ffi::{c_char, c_int};
use std::path::Path;
Expand Down
1 change: 1 addition & 0 deletions rust/index/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use chroma_cache::new_non_persistent_cache_for_test;
use chroma_storage::test_storage;
pub use hnsw::*;
use hnsw_provider::HnswIndexProvider;
#[allow(unused_imports)]
pub use spann::*;
use tempfile::tempdir;
pub use types::*;
Expand Down
4 changes: 2 additions & 2 deletions rust/index/src/spann/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::collections::HashMap;

use arrow::error;
use chroma_blockstore::{provider::BlockfileProvider, BlockfileWriter, BlockfileWriterOptions};
use chroma_distance::DistanceFunction;
use chroma_error::{ChromaError, ErrorCodes};
Expand All @@ -14,6 +13,7 @@ use crate::{
};

// TODO(Sanket): Add locking structures as necessary.
#[allow(dead_code)]
pub struct SpannIndexWriter {
// HNSW index and its provider for centroid search.
hnsw_index: HnswIndexRef,
Expand Down Expand Up @@ -125,7 +125,7 @@ impl SpannIndexWriter {
) -> Result<BlockfileWriter, SpannIndexWriterConstructionError> {
let mut bf_options = BlockfileWriterOptions::new();
bf_options = bf_options.unordered_mutations();
bf_options = bf_options.fork(blockfile_id.clone());
bf_options = bf_options.fork(*blockfile_id);
match blockfile_provider
.write::<u32, &SpannPostingList<'_>>(bf_options)
.await
Expand Down
5 changes: 2 additions & 3 deletions rust/index/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use chroma_distance::{DistanceFunction, DistanceFunctionError};
use chroma_error::{ChromaError, ErrorCodes};
use thiserror::Error;
use chroma_distance::DistanceFunction;
use chroma_error::ChromaError;
use uuid::Uuid;

#[derive(Clone, Debug)]
Expand Down
7 changes: 3 additions & 4 deletions rust/worker/src/segment/distributed_hnsw_segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ use super::record_segment::ApplyMaterializedLogError;
use super::utils::hnsw_params_from_segment;
use super::{SegmentFlusher, SegmentWriter};
use async_trait::async_trait;
use chroma_distance::{DistanceFunction, DistanceFunctionError};
use chroma_distance::DistanceFunctionError;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_index::hnsw_provider::{
HnswIndexProvider, HnswIndexProviderCreateError, HnswIndexProviderForkError,
HnswIndexProviderOpenError, HnswIndexRef,
};
use chroma_index::{HnswIndexConfig, Index, IndexConfig, IndexUuid};
use chroma_index::{DEFAULT_HNSW_EF_CONSTRUCTION, DEFAULT_HNSW_EF_SEARCH, DEFAULT_HNSW_M};
use chroma_index::{Index, IndexUuid};
use chroma_types::SegmentUuid;
use chroma_types::{get_metadata_value_as, MaterializedLogOperation, MetadataValue, Segment};
use chroma_types::{MaterializedLogOperation, Segment};
use std::collections::HashMap;
use std::fmt::Debug;
use thiserror::Error;
Expand Down
10 changes: 6 additions & 4 deletions rust/worker/src/segment/spann_segment.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
use std::collections::HashMap;

use arrow::error;
use chroma_blockstore::provider::BlockfileProvider;
use chroma_error::{ChromaError, ErrorCodes};
use chroma_index::{hnsw_provider::HnswIndexProvider, spann::types::SpannIndexWriter, IndexUuid};
Expand All @@ -10,10 +7,14 @@ use uuid::Uuid;

use super::utils::{distance_function_from_segment, hnsw_params_from_segment};

#[allow(dead_code)]
const HNSW_PATH: &str = "hnsw_path";
#[allow(dead_code)]
const VERSION_MAP_PATH: &str = "version_map_path";
#[allow(dead_code)]
const POSTING_LIST_PATH: &str = "posting_list_path";

#[allow(dead_code)]
pub(crate) struct SpannSegmentWriter {
index: SpannIndexWriter,
id: SegmentUuid,
Expand Down Expand Up @@ -52,6 +53,7 @@ impl ChromaError for SpannSegmentWriterError {
}

impl SpannSegmentWriter {
#[allow(dead_code)]
pub async fn from_segment(
segment: &Segment,
blockfile_provider: &BlockfileProvider,
Expand All @@ -63,7 +65,7 @@ impl SpannSegmentWriter {
}
let distance_function = match distance_function_from_segment(segment) {
Ok(distance_function) => distance_function,
Err(e) => {
Err(_) => {
return Err(SpannSegmentWriterError::DistanceFunctionNotFound);
}
};
Expand Down

0 comments on commit 1e1e6be

Please sign in to comment.