From 0d994f6eeab01ed3bbfb6b1e436dde6ab9ff417d Mon Sep 17 00:00:00 2001 From: Wilson Marcilio-Jr Date: Fri, 25 Oct 2024 17:20:48 -0300 Subject: [PATCH 1/7] handle unique org for apikeys --- nomic/dataset.py | 6 ++++++ setup.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nomic/dataset.py b/nomic/dataset.py index fa412f3..7007732 100644 --- a/nomic/dataset.py +++ b/nomic/dataset.py @@ -140,6 +140,9 @@ def _get_current_users_main_organization(self): if organization["user_id"] == user["sub"] and organization["access_role"] == "OWNER": return organization + for organization in user["organizations"]: + if organization["user_id"] == user["sub"]: + return organization return {} def _delete_project_by_id(self, project_id): @@ -213,6 +216,9 @@ def _get_dataset_by_slug_identifier(self, identifier: str): headers=self.header, ) + if response.status_code == 403: + raise ValueError(response.json()['detail']) + if response.status_code != 200: return None diff --git a/setup.py b/setup.py index 7ef94bb..43ebfc3 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="nomic", - version="3.1.2", + version="3.1.3", url="https://github.com/nomic-ai/nomic", description=description, long_description=description, From 7e86ccdefcb4208907ab6382689c5df6a53f119e Mon Sep 17 00:00:00 2001 From: Wilson Marcilio-Jr Date: Mon, 28 Oct 2024 17:54:36 -0300 Subject: [PATCH 2/7] lint --- nomic/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nomic/dataset.py b/nomic/dataset.py index 7007732..b17cd82 100644 --- a/nomic/dataset.py +++ b/nomic/dataset.py @@ -217,7 +217,7 @@ def _get_dataset_by_slug_identifier(self, identifier: str): ) if response.status_code == 403: - raise ValueError(response.json()['detail']) + raise ValueError(response.json()["detail"]) if response.status_code != 200: return None From f2381ff4b4ffe004d120d3e940f95f1c25ebb57c Mon Sep 17 00:00:00 2001 From: Wilson Marcilio-Jr Date: Mon, 28 Oct 2024 18:02:48 -0300 Subject: [PATCH 3/7] update pyright version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 43ebfc3..496048e 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ "pylint", "pytest", "isort", - "pyright", + "pyright==1.1.359", "myst-parser", "mkdocs-material", "mkautodoc", From d9e70fab3548f4a8472f2c9e4eaa8e0c7501d186 Mon Sep 17 00:00:00 2001 From: Wilson Marcilio-Jr Date: Mon, 28 Oct 2024 18:05:51 -0300 Subject: [PATCH 4/7] fix conflict --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 496048e..34b7d22 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ "pylint", "pytest", "isort", - "pyright==1.1.359", + "pyright<=1.1.377", "myst-parser", "mkdocs-material", "mkautodoc", From 4a449766c3c196aceea11025c2f987261703c927 Mon Sep 17 00:00:00 2001 From: Wilson Marcilio-Jr Date: Tue, 29 Oct 2024 12:35:20 -0300 Subject: [PATCH 5/7] hint org name --- nomic/dataset.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nomic/dataset.py b/nomic/dataset.py index b17cd82..6c810ef 100644 --- a/nomic/dataset.py +++ b/nomic/dataset.py @@ -833,6 +833,9 @@ def _create_project( organization_id = self._get_organization_by_slug(slug=identifier) project_slug = identifier.split("/")[1] + if "/" in identifier: + org_name = identifier.split("/")[0] + logger.info(f"Organization name: `{org_name}`") # supported_modalities = ['text', 'embedding'] # if modality not in supported_modalities: # msg = 'Tried to create dataset with modality: {}, but Atlas only supports: {}'.format( From 00757acbc5dfbf32495b04f447c74e5d15d7e284 Mon Sep 17 00:00:00 2001 From: Wilson Marcilio-Jr Date: Tue, 29 Oct 2024 12:43:50 -0300 Subject: [PATCH 6/7] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 34b7d22..1f0ed32 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="nomic", - version="3.1.3", + version="3.1.4", url="https://github.com/nomic-ai/nomic", description=description, long_description=description, From de03cdc9c9ef5af745ded719b4b79777dfb04032 Mon Sep 17 00:00:00 2001 From: Benjamin Schmidt Date: Tue, 29 Oct 2024 12:00:06 -0400 Subject: [PATCH 7/7] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1f0ed32..34b7d22 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="nomic", - version="3.1.4", + version="3.1.3", url="https://github.com/nomic-ai/nomic", description=description, long_description=description,