Skip to content

Commit

Permalink
fix(community): Column VEC_VECTOR has the wrong length (langchain-ai#…
Browse files Browse the repository at this point in the history
…6914)

Signed-off-by: Prashant Rakheja <[email protected]>
  • Loading branch information
prashantrakheja authored Oct 2, 2024
1 parent 97ac768 commit a7c46f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/langchain-community/src/vectorstores/hanavector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,11 @@ export class HanaDB extends VectorStore {
throw new Error(`Column ${columnName} has the wrong type: ${dataType}`);
}

// Length can either be -1 (QRC01+02-24) or 0 (QRC03-24 onwards)
// to indicate no length constraint being present.

// Check length, if parameter was provided
if (columnLength !== undefined && length !== columnLength) {
if (columnLength !== undefined && length !== columnLength && length > 0) {
throw new Error(`Column ${columnName} has the wrong length: ${length}`);
}
}
Expand Down

0 comments on commit a7c46f5

Please sign in to comment.