convexity-sdk 0.17.0.dev313__tar.gz → 0.17.0.dev317__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.
Files changed (97) hide show
  1. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/.gitignore +1 -1
  2. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/PKG-INFO +1 -1
  3. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/olap.py +68 -17
  4. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/pyproject.toml +1 -1
  5. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/README.md +0 -0
  6. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/__init__.py +0 -0
  7. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/client.py +0 -0
  8. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/config.py +0 -0
  9. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/exceptions.py +0 -0
  10. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/http.py +0 -0
  11. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/models/__init__.py +0 -0
  12. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/__init__.py +0 -0
  13. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/address_book.py +0 -0
  14. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/analytics.py +0 -0
  15. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/api_keys.py +0 -0
  16. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/attributes.py +0 -0
  17. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/categories.py +0 -0
  18. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/classification.py +0 -0
  19. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/connections.py +0 -0
  20. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/cost_lists.py +0 -0
  21. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/crm.py +0 -0
  22. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/dashboards.py +0 -0
  23. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/datasets.py +0 -0
  24. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/email.py +0 -0
  25. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/environments.py +0 -0
  26. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/erp_config.py +0 -0
  27. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/inventory.py +0 -0
  28. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/issues.py +0 -0
  29. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/organizations.py +0 -0
  30. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/pricing.py +0 -0
  31. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/projects.py +0 -0
  32. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/purchasing.py +0 -0
  33. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/rbac.py +0 -0
  34. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/replenishment.py +0 -0
  35. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/runs.py +0 -0
  36. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/sales.py +0 -0
  37. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/sales_channels.py +0 -0
  38. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/tasks.py +0 -0
  39. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/templates.py +0 -0
  40. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/usage.py +0 -0
  41. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/warehouses.py +0 -0
  42. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/worker_tasks.py +0 -0
  43. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/convexity_sdk/resources/workspace.py +0 -0
  44. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/.env.example +0 -0
  45. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/README.md +0 -0
  46. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/cancel_refresh_task.py +0 -0
  47. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/compare_api_key_scopes.py +0 -0
  48. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/create_csv_datasets.py +0 -0
  49. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/create_dashboards.py +0 -0
  50. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/create_databricks_connections.py +0 -0
  51. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/create_datasets.py +0 -0
  52. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/create_forecast_task.py +0 -0
  53. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/create_org_and_project.py +0 -0
  54. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/create_single_project_api_key.py +0 -0
  55. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/crm/001_check_crm_enabled.py +0 -0
  56. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/crm/002_enable_crm.py +0 -0
  57. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/crm/003_manage_customers.py +0 -0
  58. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/crm/004_disable_crm.py +0 -0
  59. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/getting_started.py +0 -0
  60. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/001_check_inventory_enabled.py +0 -0
  61. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/002_enable_inventory.py +0 -0
  62. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/003_manage_inventory_items.py +0 -0
  63. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/004_manage_inventory_stock.py +0 -0
  64. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/005_disable_inventory.py +0 -0
  65. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/006_manage_categories.py +0 -0
  66. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/007_manage_inventory_config.py +0 -0
  67. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/inventory/008_manage_cost_lists.py +0 -0
  68. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/list_orgs_and_projects.py +0 -0
  69. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/manage_environments.py +0 -0
  70. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/manage_issues.py +0 -0
  71. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/project_usage.py +0 -0
  72. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/purchasing/001_check_purchasing_enabled.py +0 -0
  73. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/purchasing/002_enable_purchasing.py +0 -0
  74. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/purchasing/003_manage_vendors.py +0 -0
  75. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/purchasing/004_manage_purchase_orders.py +0 -0
  76. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/purchasing/005_disable_purchasing.py +0 -0
  77. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/query_olap.py +0 -0
  78. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/quickbook/001_check_quickbook_connection.py +0 -0
  79. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/quickbook/002_create_quickbook_datasets.py +0 -0
  80. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/rbac/001_manage_roles.py +0 -0
  81. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/rbac/002_manage_assignments.py +0 -0
  82. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/rbac/003_verify_rbac_access.py +0 -0
  83. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/sales/001_check_sales_enabled.py +0 -0
  84. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/sales/002_enable_sales.py +0 -0
  85. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/sales/003_manage_sales_invoices.py +0 -0
  86. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/sales/004_manage_sales_invoice_lifecycle.py +0 -0
  87. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/sales/005_manage_sales_orders.py +0 -0
  88. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/sales/006_disable_sales.py +0 -0
  89. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/share_dashboard.py +0 -0
  90. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/shopify/001_check_shopify_connection.py +0 -0
  91. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/shopify/002_create_shopify_datasets.py +0 -0
  92. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/uci/001_setup.py +0 -0
  93. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/uci/002_seed_inventory_from_uci.py +0 -0
  94. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/uci/003_seed_sales_from_uci.py +0 -0
  95. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/uci/004_seed_purchasing_from_uci.py +0 -0
  96. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/uci/005_run_pipelines.py +0 -0
  97. {convexity_sdk-0.17.0.dev313 → convexity_sdk-0.17.0.dev317}/samples/workspace_files.py +0 -0
@@ -44,7 +44,7 @@ ducklake_data/
44
44
  .playwright-mcp
45
45
 
46
46
  # Generated CLI API client (regenerated via `npm run generate:api`)
47
- packages/.generated/
47
+ packages/py/generated/
48
48
  .wrangler
49
49
  pp_perfume/
50
50
  data/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: convexity-sdk
3
- Version: 0.17.0.dev313
3
+ Version: 0.17.0.dev317
4
4
  Summary: Convexity Python SDK - programmatic access to the Convexity platform
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: convexity-api-client
@@ -2,6 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from dataclasses import dataclass, field
6
+ import json
7
+ from typing import Any
8
+
5
9
  from convexity_api_client import AuthenticatedClient, Client
6
10
  from convexity_api_client.api.v1 import (
7
11
  get_olap_connection_v1_olap_connection_get as _get_olap_connection,
@@ -12,21 +16,48 @@ from convexity_api_client.api.v1 import (
12
16
  from convexity_api_client.api.v1 import (
13
17
  list_olap_tables_v1_olap_tables_get as _list_olap_tables,
14
18
  )
15
- from convexity_api_client.api.v1 import (
16
- run_olap_query_v1_olap_query_post as _run_olap_query,
17
- )
18
19
  from convexity_api_client.api.v1 import (
19
20
  vacuum_olap_v1_olap_vacuum_post as _vacuum_olap,
20
21
  )
21
22
  from convexity_api_client.models.olap_connection_response import OlapConnectionResponse
22
- from convexity_api_client.models.olap_query_request import OlapQueryRequest
23
- from convexity_api_client.models.olap_query_request_params import OlapQueryRequestParams
24
- from convexity_api_client.models.olap_query_response import OlapQueryResponse
25
23
  from convexity_api_client.models.olap_table import OlapTable
26
24
  from convexity_api_client.models.olap_table_list import OlapTableList
27
25
  from convexity_api_client.models.olap_table_schema import OlapTableSchema
28
26
  from convexity_api_client.models.olap_vacuum_response import OlapVacuumResponse
29
- from convexity_api_client.types import UNSET, Unset
27
+ from convexity_api_client.types import Unset
28
+
29
+
30
+ @dataclass
31
+ class OlapQueryColumn:
32
+ """A column in an OLAP query result."""
33
+
34
+ name: str
35
+ type_: str | None = None
36
+
37
+
38
+ @dataclass
39
+ class OlapQueryRow:
40
+ """A single OLAP query result row (column name -> value)."""
41
+
42
+ additional_properties: dict[str, Any] = field(default_factory=dict)
43
+
44
+
45
+ @dataclass
46
+ class OlapQueryResult:
47
+ """Result of a server-side OLAP query.
48
+
49
+ Defined locally in the SDK because the ``/olap/query`` endpoint is
50
+ intentionally excluded from the generated client contract — reading the
51
+ Iceberg tables directly with the vended S3 credentials is the recommended
52
+ path. This convenience wrapper posts to the endpoint and parses the JSON
53
+ response into a stable shape.
54
+ """
55
+
56
+ columns: list[OlapQueryColumn] = field(default_factory=list)
57
+ rows: list[OlapQueryRow] = field(default_factory=list)
58
+ row_count: int = 0
59
+ truncated: bool = False
60
+ elapsed_ms: int = 0
30
61
 
31
62
 
32
63
  class Olap:
@@ -72,17 +103,37 @@ class Olap:
72
103
  *,
73
104
  params: dict[str, object] | None = None,
74
105
  max_rows: int = 10000,
75
- ) -> OlapQueryResponse:
76
- """Run a read-only (SELECT/WITH) query against the project's Iceberg tables."""
77
- query_params: OlapQueryRequestParams | Unset = UNSET
106
+ ) -> OlapQueryResult:
107
+ """Run a read-only (SELECT/WITH) query against the project's Iceberg tables.
108
+
109
+ Prefer reading the tables directly with the vended S3 credentials
110
+ (``get_connection`` + ``list_tables_detailed`` + a local Iceberg engine
111
+ such as DuckDB). This server-side query endpoint is a convenience
112
+ fallback and is intentionally excluded from the generated client
113
+ contract, so the request/response are handled here directly.
114
+ """
115
+ body: dict[str, Any] = {"sql": sql, "maxRows": max_rows}
78
116
  if params is not None:
79
- query_params = OlapQueryRequestParams()
80
- query_params.additional_properties = dict(params)
81
- body = OlapQueryRequest(sql=sql, params=query_params, max_rows=max_rows)
82
- result = _run_olap_query.sync(client=self._client, body=body, project_id=project_id)
83
- if not isinstance(result, OlapQueryResponse):
84
- raise ValueError(f"Unexpected response when running OLAP query: {result}")
85
- return result
117
+ body["params"] = dict(params)
118
+ raw_body = json.dumps(body).encode("utf-8")
119
+ response = self._client.get_httpx_client().post(
120
+ "/v1/olap/query",
121
+ params={"projectId": project_id},
122
+ content=raw_body,
123
+ headers={"Content-Type": "application/json"},
124
+ )
125
+ if response.status_code != 200:
126
+ raise ValueError(f"OLAP query failed ({response.status_code}): {response.text}")
127
+ data = response.json()
128
+ columns = [OlapQueryColumn(name=col.get("name", ""), type_=col.get("type")) for col in data.get("columns", [])]
129
+ rows = [OlapQueryRow(additional_properties=dict(row)) for row in data.get("rows", [])]
130
+ return OlapQueryResult(
131
+ columns=columns,
132
+ rows=rows,
133
+ row_count=int(data.get("rowCount", len(rows))),
134
+ truncated=bool(data.get("truncated", False)),
135
+ elapsed_ms=int(data.get("elapsedMs", 0)),
136
+ )
86
137
 
87
138
  def vacuum(self, project_id: str) -> OlapVacuumResponse:
88
139
  """Drop orphaned Iceberg tables from the project's OLAP namespace.
@@ -15,7 +15,7 @@ requires = ["hatchling"]
15
15
  build-backend = "hatchling.build"
16
16
 
17
17
  [tool.hatch.version]
18
- path = "../../package.json"
18
+ path = "../../../package.json"
19
19
  pattern = '"version":\s*"(?P<version>[^"]+)"'
20
20
 
21
21
  [tool.hatch.build.targets.wheel]