Skip to content

Commit 54f542c

Browse files
dudanogueirahntrl
andauthored
chore(weaviate): Adds invalid metadata integration test (#8971)
Co-authored-by: Hunter Lovell <[email protected]>
1 parent 57f1250 commit 54f542c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.changeset/slow-clouds-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@langchain/weaviate": patch
3+
---
4+
5+
Make flattenObjectForWeaviate more resilient

libs/langchain-weaviate/src/tests/vectorstores.int.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,28 @@ test("WeaviateStore with limited metadatakeys", async () => {
294294
}
295295
});
296296

297+
test("invalid metadata name", async () => {
298+
const weaviateArgs = {
299+
client,
300+
indexName: "TestInvalidMetadataKeys",
301+
textKey: "text",
302+
};
303+
await WeaviateStore.fromTexts(
304+
["hello world"],
305+
[{ "pdf_metadata__metadata_xmp:createdate": "bar" }],
306+
new FakeEmbeddings(),
307+
weaviateArgs
308+
);
309+
try {
310+
const total = await client.collections
311+
.get(weaviateArgs.indexName)
312+
.aggregate.overAll();
313+
expect(total.totalCount).toEqual(1);
314+
} finally {
315+
await client.collections.delete(weaviateArgs.indexName);
316+
}
317+
});
318+
297319
test("WeaviateStore delete with filter", async () => {
298320
const weaviateArgs = {
299321
client,

0 commit comments

Comments
 (0)