Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nolan/collections summary #1685

Merged
merged 8 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ repos:
types: [python]
pass_filenames: false

- repo: local
hooks:
- id: check-print-statements
name: Check for print statements
entry: bash -c 'echo "Checking for print statements..." && find . -name "*.py" ! -path "./py/cli/*" ! -path "./py/core/examples/*" ! -path "./py/migrations/*" ! -path "./py/tests/*" | xargs grep -n "print(" || exit 0 && echo "Found print statements!" && exit 1'
language: system
types: [python]
pass_filenames: false

- repo: local
hooks:
- id: isort
Expand Down
12 changes: 12 additions & 0 deletions js/sdk/__tests__/CollectionsIntegrationSuperUser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,26 @@ describe("r2rClient V3 Collections Integration Tests", () => {
test("Retrieve collection", async () => {
const response = await client.collections.retrieve({ id: collectionId });
expect(response.results).toBeDefined();
expect(response.results.id).toBe(collectionId);
expect(response.results.name).toBe("Test Collection");
expect(response.results.description).toBeNull();
});

test("Update collection", async () => {
const response = await client.collections.update({
id: collectionId,
name: "Updated Test Collection",
generateDescription: true,
});
expect(response.results).toBeDefined();
}, 10000);

test("Retrieve updated collection", async () => {
const response = await client.collections.retrieve({ id: collectionId });
expect(response.results).toBeDefined();
expect(response.results.id).toBe(collectionId);
expect(response.results.name).toBe("Updated Test Collection");
expect(response.results.description).toBeDefined();
});

test("Ingest document and assign to collection", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe("r2rClient V3 System Integration Tests User", () => {

expect(response.results.document_id).toBeDefined();
user1DocumentId = response.results.document_id;
}, 10000);
}, 15000);

test("Create document as user 2 with file path", async () => {
const response = await user2Client.documents.create({
Expand All @@ -126,7 +126,7 @@ describe("r2rClient V3 System Integration Tests User", () => {

expect(response.results.document_id).toBeDefined();
user2DocumentId = response.results.document_id;
}, 10000);
}, 15000);

test("Retrieve document as user 1", async () => {
const response = await user1Client.documents.retrieve({
Expand Down
2 changes: 2 additions & 0 deletions js/sdk/__tests__/GraphsIntegrationSuperUser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ describe("r2rClient V3 Graphs Integration Tests", () => {
predicate: "falls in love with",
object: "Dunia",
objectId: entity2Id,
description: "Razumikhn and Dunia are central to the story",
});

relationshipId = response.results.id;
Expand All @@ -236,6 +237,7 @@ describe("r2rClient V3 Graphs Integration Tests", () => {
expect(response.results.subject).toBe("Razumikhin");
expect(response.results.object).toBe("Dunia");
expect(response.results.predicate).toBe("falls in love with");
expect(response.results.description).toBe("Razumikhn and Dunia are central to the story");
});

test("Retrieve the relationship", async () => {
Expand Down
Loading
Loading