From c886ce31a4ca1b61d3269351dce5c3d2d01f18ee Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Wed, 6 Mar 2024 13:14:23 -0600 Subject: [PATCH] trim leading/trailing whitespace (#74) * trim leading/trailing whitespace * bump ver * add missing migration --- Cargo.lock | 2 +- Cargo.toml | 2 +- Trunk.toml | 2 +- sql/vectorize--0.12.0--0.12.1.sql | 0 src/executor.rs | 2 +- src/job.rs | 4 ++-- 6 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 sql/vectorize--0.12.0--0.12.1.sql diff --git a/Cargo.lock b/Cargo.lock index bbdbf8f..a5c590b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2995,7 +2995,7 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vectorize" -version = "0.12.0" +version = "0.12.1" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 2e19ea6..4470d98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vectorize" -version = "0.12.0" +version = "0.12.1" edition = "2021" publish = false diff --git a/Trunk.toml b/Trunk.toml index 8963fca..ed42388 100644 --- a/Trunk.toml +++ b/Trunk.toml @@ -6,7 +6,7 @@ description = "The simplest way to orchestrate vector search on Postgres." homepage = "https://github.com/tembo-io/pg_vectorize" documentation = "https://github.com/tembo-io/pg_vectorize" categories = ["orchestration", "machine_learning"] -version = "0.12.0" +version = "0.12.1" [build] postgres_version = "15" diff --git a/sql/vectorize--0.12.0--0.12.1.sql b/sql/vectorize--0.12.0--0.12.1.sql new file mode 100644 index 0000000..e69de29 diff --git a/src/executor.rs b/src/executor.rs index f45e8ba..e6ff80b 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -248,7 +248,7 @@ pub async fn get_new_updates( let token_estimate = bpe.encode_with_special_tokens(&ipt).len() as i32; new_inputs.push(Inputs { record_id: r.get("record_id"), - inputs: ipt, + inputs: ipt.trim().to_owned(), token_estimate, }) } diff --git a/src/job.rs b/src/job.rs index 7a74873..ca2dc1e 100644 --- a/src/job.rs +++ b/src/job.rs @@ -33,7 +33,7 @@ fn _handle_table_update(job_name: &str, record_ids: Vec, inputs: Vec()? .expect("record_id is null"), - inputs: ipt, + inputs: ipt.trim().to_owned(), token_estimate, }); }