poelis-sdk 0.1.6__tar.gz → 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of poelis-sdk might be problematic. Click here for more details.

Files changed (30) hide show
  1. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/PKG-INFO +1 -1
  2. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/notebooks/try_poelis_sdk.ipynb +2 -2
  3. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/pyproject.toml +1 -1
  4. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/models.py +1 -0
  5. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/org_validation.py +0 -4
  6. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/products.py +10 -3
  7. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/uv.lock +1 -1
  8. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/.github/workflows/ci.yml +0 -0
  9. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/.github/workflows/codeql.yml +0 -0
  10. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/.github/workflows/publish-on-push.yml +0 -0
  11. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/.gitignore +0 -0
  12. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/LICENSE +0 -0
  13. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/README.md +0 -0
  14. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/__init__.py +0 -0
  15. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/_transport.py +0 -0
  16. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/auth0.py +0 -0
  17. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/browser.py +0 -0
  18. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/client.py +0 -0
  19. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/exceptions.py +0 -0
  20. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/items.py +0 -0
  21. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/logging.py +0 -0
  22. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/search.py +0 -0
  23. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/poelis_sdk/workspaces.py +0 -0
  24. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/tests/test_client_basic.py +0 -0
  25. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/tests/test_errors_and_backoff.py +0 -0
  26. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/tests/test_items_client.py +0 -0
  27. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/tests/test_search_client.py +0 -0
  28. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/src/tests/test_transport_and_products.py +0 -0
  29. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/tests/__init__.py +0 -0
  30. {poelis_sdk-0.1.6 → poelis_sdk-0.1.7}/tests/test_integration_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: poelis-sdk
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Official Python SDK for Poelis
5
5
  Project-URL: Homepage, https://poelis.com
6
6
  Project-URL: Source, https://github.com/PoelisTechnologies/poelis-python-sdk
@@ -34,7 +34,7 @@
34
34
  "First, let's install the Poelis Python SDK. The SDK requires Python 3.11 or higher.\n",
35
35
  "\n",
36
36
  "```bash\n",
37
- "pip install poelis-sdk\n",
37
+ "pip install -U poelis-sdk\n",
38
38
  "```\n",
39
39
  "\n",
40
40
  "### Requirements\n",
@@ -57,7 +57,7 @@
57
57
  }
58
58
  ],
59
59
  "source": [
60
- "!pip install poelis-sdk"
60
+ "!pip install -U poelis-sdk"
61
61
  ]
62
62
  },
63
63
  {
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "poelis-sdk"
7
- version = "0.1.6"
7
+ version = "0.1.7"
8
8
  description = "Official Python SDK for Poelis"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -13,6 +13,7 @@ class Product(BaseModel):
13
13
  id: str = Field(min_length=1)
14
14
  name: str = Field(min_length=1)
15
15
  workspace_id: Optional[str] = None
16
+ org_id: Optional[str] = None
16
17
 
17
18
 
18
19
  class PaginatedProducts(BaseModel):
@@ -77,10 +77,6 @@ def filter_by_organization(data_list: List[Dict[str, Any]], expected_org_id: str
77
77
  else:
78
78
  cross_org_count += 1
79
79
 
80
- if cross_org_count > 0:
81
- # Log warning about cross-org data (but don't fail)
82
- print(f"⚠️ Warning: Filtered out {cross_org_count} {data_type} from other organizations")
83
-
84
80
  return filtered
85
81
 
86
82
 
@@ -4,6 +4,7 @@ from typing import Generator, Optional, List, TYPE_CHECKING
4
4
 
5
5
  from ._transport import Transport
6
6
  from .models import PaginatedProducts, Product
7
+ from .org_validation import filter_by_organization
7
8
 
8
9
  if TYPE_CHECKING:
9
10
  from .workspaces import WorkspacesClient
@@ -32,7 +33,7 @@ class ProductsClient:
32
33
 
33
34
  query = (
34
35
  "query($ws: ID!, $q: String, $limit: Int!, $offset: Int!) {\n"
35
- " products(workspaceId: $ws, q: $q, limit: $limit, offset: $offset) { id name code description workspaceId }\n"
36
+ " products(workspaceId: $ws, q: $q, limit: $limit, offset: $offset) { id name code description workspaceId orgId }\n"
36
37
  "}"
37
38
  )
38
39
  variables = {"ws": workspace_id, "q": q, "limit": int(limit), "offset": int(offset)}
@@ -41,8 +42,14 @@ class ProductsClient:
41
42
  payload = resp.json()
42
43
  if "errors" in payload:
43
44
  raise RuntimeError(str(payload["errors"]))
44
- rows: List[dict] = payload.get("data", {}).get("products", [])
45
- return PaginatedProducts(data=[Product(**r) for r in rows], limit=limit, offset=offset)
45
+
46
+ products = payload.get("data", {}).get("products", [])
47
+
48
+ # Client-side organization filtering as backup protection
49
+ expected_org_id = self._t._org_id
50
+ filtered_products = filter_by_organization(products, expected_org_id, "products")
51
+
52
+ return PaginatedProducts(data=[Product(**r) for r in filtered_products], limit=limit, offset=offset)
46
53
 
47
54
  def iter_all_by_workspace(self, *, workspace_id: str, q: Optional[str] = None, page_size: int = 100, start_offset: int = 0) -> Generator[Product, None, None]:
48
55
  """Iterate products via GraphQL with offset pagination for a workspace."""
@@ -538,7 +538,7 @@ wheels = [
538
538
 
539
539
  [[package]]
540
540
  name = "poelis-sdk"
541
- version = "0.1.6"
541
+ version = "0.1.7"
542
542
  source = { editable = "." }
543
543
  dependencies = [
544
544
  { name = "build" },
File without changes
File without changes
File without changes
File without changes