From 97775d65b13e9453629960191a555068e010b1e7 Mon Sep 17 00:00:00 2001 From: Garance Date: Fri, 18 Oct 2024 15:38:34 -0400 Subject: [PATCH] fix: revert fixture file, remove fixtures from cargo toml examples --- rig-lancedb/Cargo.toml | 4 ---- rig-lancedb/examples/{fixtures.rs => fixtures/lib.rs} | 2 -- rig-lancedb/examples/vector_search_local_ann.rs | 4 ++-- rig-lancedb/examples/vector_search_local_enn.rs | 4 ++-- rig-lancedb/examples/vector_search_s3_ann.rs | 4 ++-- 5 files changed, 6 insertions(+), 12 deletions(-) rename rig-lancedb/examples/{fixtures.rs => fixtures/lib.rs} (99%) diff --git a/rig-lancedb/Cargo.toml b/rig-lancedb/Cargo.toml index 1020e36e..b93644e9 100644 --- a/rig-lancedb/Cargo.toml +++ b/rig-lancedb/Cargo.toml @@ -15,10 +15,6 @@ futures = "0.3.30" tokio = "1.40.0" anyhow = "1.0.89" -[[example]] -name = "fixtures" -required-features = ["rig-core/derive"] - [[example]] name = "vector_search_local_ann" required-features = ["rig-core/derive"] diff --git a/rig-lancedb/examples/fixtures.rs b/rig-lancedb/examples/fixtures/lib.rs similarity index 99% rename from rig-lancedb/examples/fixtures.rs rename to rig-lancedb/examples/fixtures/lib.rs index 8ed72dba..d6e02a5a 100644 --- a/rig-lancedb/examples/fixtures.rs +++ b/rig-lancedb/examples/fixtures/lib.rs @@ -13,8 +13,6 @@ pub struct FakeDefinition { pub definition: String, } -fn main() {} - pub fn fake_definitions() -> Vec { vec![ FakeDefinition { diff --git a/rig-lancedb/examples/vector_search_local_ann.rs b/rig-lancedb/examples/vector_search_local_ann.rs index 09294a67..23ad47b5 100644 --- a/rig-lancedb/examples/vector_search_local_ann.rs +++ b/rig-lancedb/examples/vector_search_local_ann.rs @@ -1,7 +1,7 @@ use std::{env, sync::Arc}; use arrow_array::RecordBatchIterator; -use fixture::{as_record_batch, fake_definitions, schema, FakeDefinition}; +use fixtures::{as_record_batch, fake_definitions, schema, FakeDefinition}; use lancedb::index::vector::IvfPqIndexBuilder; use rig::vector_store::VectorStoreIndex; use rig::{ @@ -10,7 +10,7 @@ use rig::{ }; use rig_lancedb::{LanceDbVectorStore, SearchParams}; -#[path = "./fixtures.rs"] +#[path = "./fixtures/lib.rs"] mod fixture; #[tokio::main] diff --git a/rig-lancedb/examples/vector_search_local_enn.rs b/rig-lancedb/examples/vector_search_local_enn.rs index f3e37d1b..dc492df4 100644 --- a/rig-lancedb/examples/vector_search_local_enn.rs +++ b/rig-lancedb/examples/vector_search_local_enn.rs @@ -1,7 +1,7 @@ use std::{env, sync::Arc}; use arrow_array::RecordBatchIterator; -use fixture::{as_record_batch, fake_definitions, schema}; +use fixtures::{as_record_batch, fake_definitions, schema}; use rig::{ embeddings::{builder::EmbeddingsBuilder, embedding::EmbeddingModel}, providers::openai::{Client, TEXT_EMBEDDING_ADA_002}, @@ -9,7 +9,7 @@ use rig::{ }; use rig_lancedb::{LanceDbVectorStore, SearchParams}; -#[path = "./fixtures.rs"] +#[path = "./fixtures/lib.rs"] mod fixture; #[tokio::main] diff --git a/rig-lancedb/examples/vector_search_s3_ann.rs b/rig-lancedb/examples/vector_search_s3_ann.rs index cb4f8e0f..a521153f 100644 --- a/rig-lancedb/examples/vector_search_s3_ann.rs +++ b/rig-lancedb/examples/vector_search_s3_ann.rs @@ -1,7 +1,7 @@ use std::{env, sync::Arc}; use arrow_array::RecordBatchIterator; -use fixture::{as_record_batch, fake_definitions, schema, FakeDefinition}; +use fixtures::{as_record_batch, fake_definitions, schema, FakeDefinition}; use lancedb::{index::vector::IvfPqIndexBuilder, DistanceType}; use rig::{ embeddings::{builder::EmbeddingsBuilder, embedding::EmbeddingModel}, @@ -10,7 +10,7 @@ use rig::{ }; use rig_lancedb::{LanceDbVectorStore, SearchParams}; -#[path = "./fixtures.rs"] +#[path = "./fixtures/lib.rs"] mod fixture; // Note: see docs to deploy LanceDB on other cloud providers such as google and azure.