convexity-sdk 0.21.0.dev394__tar.gz → 0.21.0.dev397__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.
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/PKG-INFO +1 -1
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/olap.py +29 -28
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_csv_datasets.py +3 -2
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_forecast_task.py +1 -1
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/query_olap.py +2 -1
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/.gitignore +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/README.md +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/__init__.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/client.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/config.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/exceptions.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/generated_transport.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/http.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/models/__init__.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/__init__.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_address_book_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_analytics_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_crm_customer_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_datasets_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_pricing_costing_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_purchase_orders_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_purchasing_item_sourcing_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_purchasing_vendor_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_purchasing_vendors_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_replenishment_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_sales_invoices_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_sales_orders_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_workspace_v2.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/address_book.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/analytics.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/api_keys.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/attributes.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/categories.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/classification.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/connections.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/cost_lists.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/crm.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/dashboards.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/datasets.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/email.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/environments.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/erp_config.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/imports.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/inventory.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/issues.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/logistics.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/organization_invitations.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/organizations.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/pricing.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/projects.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/purchase_order_documents.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/purchasing.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/rbac.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/replenishment.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/runs.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/sales.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/sales_channels.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/sales_invoice_documents.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/tasks.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/templates.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/usage.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/warehouses.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/worker_tasks.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/workspace.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/pyproject.toml +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/.env.example +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/018_shipment_document.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/019_fulfillment_document.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/README.md +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/cancel_refresh_task.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/compare_api_key_scopes.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_dashboards.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_datasets.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_org_and_project.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_single_project_api_key.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/001_check_crm_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/002_enable_crm.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/003_manage_customers.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/004_disable_crm.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/004_manage_sales_reps.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/getting_started.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/001_check_inventory_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/002_enable_inventory.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/003_manage_inventory_items.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/004_manage_inventory_stock.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/005_disable_inventory.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/006_manage_categories.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/007_manage_inventory_config.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/008_manage_cost_lists.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/009_list_location_items.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/010_list_item_warehouse_locations.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/inventory/011_assign_item_location.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/list_orgs_and_projects.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/manage_environments.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/manage_issues.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/project_usage.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/001_check_purchasing_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/002_enable_purchasing.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/003_manage_vendors.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/005_disable_purchasing.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/006_open_purchase_order.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/007_vendor_confirmation.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/008_vendor_shipment.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/quickbook/001_check_quickbook_connection.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/quickbook/002_create_quickbook_datasets.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/rbac/001_manage_roles.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/rbac/002_manage_assignments.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/rbac/003_verify_rbac_access.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/001_check_sales_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/002_enable_sales.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/003_manage_sales_invoices.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/004_manage_sales_invoice_lifecycle.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/005_manage_sales_orders.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/006_disable_sales.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/007_manage_customers.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/007_price_list_sales_order.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/008_accept_sales_order.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/009_import_sales_order.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/010_read_order_item_progress.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/011_close_sales_order.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/012_cancel_sales_order.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/013_create_draft_invoice.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/014_sales_order_fulfillment_method.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/015_import_invoices.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/shopify/001_check_shopify_connection.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/shopify/002_create_shopify_datasets.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/uci/001_setup.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/uci/002_seed_inventory_from_uci.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/uci/003_seed_sales_from_uci.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/uci/004_seed_purchasing_from_uci.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/uci/005_run_pipelines.py +0 -0
- {convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/workspace_files.py +0 -0
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from dataclasses import dataclass, field
|
|
6
|
-
import json
|
|
7
6
|
import time
|
|
8
7
|
from typing import Any
|
|
9
8
|
|
|
@@ -17,15 +16,19 @@ from convexity_api_v2_client import Client as V2Client
|
|
|
17
16
|
from convexity_api_v2_client.api.olap import get_olap_connection_v2 as _get_olap_connection
|
|
18
17
|
from convexity_api_v2_client.api.olap import get_olap_table_schema_v2 as _get_olap_table_schema
|
|
19
18
|
from convexity_api_v2_client.api.olap import list_olap_tables_v2 as _list_olap_tables
|
|
19
|
+
from convexity_api_v2_client.api.olap import run_olap_query_v2 as _run_olap_query
|
|
20
20
|
from convexity_api_v2_client.api.olap import vacuum_olap_v2 as _vacuum_olap
|
|
21
21
|
from convexity_api_v2_client.api.worker_tasks import get_worker_task_v2 as _get_worker_task
|
|
22
22
|
from convexity_api_v2_client.models import (
|
|
23
23
|
OlapConnectionResponseV2,
|
|
24
|
+
OlapQueryRequestV2,
|
|
25
|
+
OlapQueryResponseV2,
|
|
24
26
|
OlapTableListV2,
|
|
25
27
|
OlapTableSchemaV2,
|
|
26
28
|
OlapVacuumTaskV2,
|
|
27
29
|
WorkerTaskV2,
|
|
28
30
|
)
|
|
31
|
+
from convexity_api_v2_client.models.olap_query_request_v2_params import OlapQueryRequestV2Params
|
|
29
32
|
|
|
30
33
|
from ._v2 import parsed_or_raise
|
|
31
34
|
|
|
@@ -49,11 +52,9 @@ class OlapQueryRow:
|
|
|
49
52
|
class OlapQueryResult:
|
|
50
53
|
"""Result of a server-side OLAP query.
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
path. This convenience wrapper posts to the endpoint and parses the JSON
|
|
56
|
-
response into a stable shape.
|
|
55
|
+
This compatibility shape is retained while the SDK uses the generated V2
|
|
56
|
+
operation. Reading Iceberg tables directly with vended S3 credentials is
|
|
57
|
+
still the recommended path for callers that need a local query engine.
|
|
57
58
|
"""
|
|
58
59
|
|
|
59
60
|
columns: list[OlapQueryColumn] = field(default_factory=list)
|
|
@@ -119,37 +120,37 @@ class Olap:
|
|
|
119
120
|
sql: str,
|
|
120
121
|
*,
|
|
121
122
|
params: dict[str, object] | None = None,
|
|
122
|
-
max_rows: int =
|
|
123
|
+
max_rows: int = 9999,
|
|
123
124
|
) -> OlapQueryResult:
|
|
124
125
|
"""Run a read-only (SELECT/WITH) query against the project's Iceberg tables.
|
|
125
126
|
|
|
126
127
|
Prefer reading the tables directly with the vended S3 credentials
|
|
127
128
|
(``get_connection`` + ``list_tables_detailed`` + a local Iceberg engine
|
|
128
|
-
such as DuckDB). This
|
|
129
|
-
|
|
130
|
-
contract, so the request/response are handled here directly.
|
|
129
|
+
such as DuckDB). This convenience method retains its public API but
|
|
130
|
+
delegates to the native V2 R2 SQL operation.
|
|
131
131
|
"""
|
|
132
|
-
body
|
|
133
|
-
if params
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
132
|
+
body = OlapQueryRequestV2(sql=sql, max_rows=max_rows)
|
|
133
|
+
if params:
|
|
134
|
+
request_params = OlapQueryRequestV2Params()
|
|
135
|
+
request_params.additional_properties = dict(params)
|
|
136
|
+
body.params = request_params
|
|
137
|
+
response = _run_olap_query.sync_detailed(
|
|
138
|
+
project_id,
|
|
139
|
+
client=self._v2_client,
|
|
140
|
+
body=body,
|
|
141
141
|
)
|
|
142
142
|
if response.status_code != 200:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
detail = response.parsed.detail if hasattr(response.parsed, "detail") else "OLAP query failed"
|
|
144
|
+
raise ValueError(f"OLAP query failed ({response.status_code}): {detail}")
|
|
145
|
+
result = response.parsed
|
|
146
|
+
if not isinstance(result, OlapQueryResponseV2):
|
|
147
|
+
raise ValueError(f"Unexpected OLAP query response: {result}")
|
|
147
148
|
return OlapQueryResult(
|
|
148
|
-
columns=columns,
|
|
149
|
-
rows=rows,
|
|
150
|
-
row_count=
|
|
151
|
-
truncated=
|
|
152
|
-
elapsed_ms=
|
|
149
|
+
columns=[OlapQueryColumn(name=column.name, type_=column.type_) for column in result.columns],
|
|
150
|
+
rows=[OlapQueryRow(additional_properties=dict(row.additional_properties)) for row in result.rows],
|
|
151
|
+
row_count=result.row_count,
|
|
152
|
+
truncated=result.truncated,
|
|
153
|
+
elapsed_ms=result.elapsed_ms,
|
|
153
154
|
)
|
|
154
155
|
|
|
155
156
|
def vacuum(self, project_id: str) -> OlapVacuumResponse:
|
|
@@ -160,6 +160,7 @@ print("\nQuerying CSV dataset via the OLAP endpoint …")
|
|
|
160
160
|
# OLAP table names are derived from the dataset ID:
|
|
161
161
|
# ds_<uuid_with_underscores>
|
|
162
162
|
table_name = f"ds_{csv_dataset.id.replace('-', '_')}"
|
|
163
|
+
namespace = f"proj_{project.id.replace('-', '_')}"
|
|
163
164
|
|
|
164
165
|
|
|
165
166
|
def _print_olap_result(response: object) -> None:
|
|
@@ -175,7 +176,7 @@ def _print_olap_result(response: object) -> None:
|
|
|
175
176
|
|
|
176
177
|
|
|
177
178
|
# Query 1: Preview the CSV-backed table
|
|
178
|
-
preview_sql = f'SELECT * FROM "{table_name}" LIMIT 5;'
|
|
179
|
+
preview_sql = f'SELECT * FROM "{namespace}"."{table_name}" LIMIT 5;'
|
|
179
180
|
print(f"\n Query: {preview_sql}")
|
|
180
181
|
_print_olap_result(client.olap.query(project.id, preview_sql))
|
|
181
182
|
|
|
@@ -186,7 +187,7 @@ SELECT
|
|
|
186
187
|
COUNT(*) AS product_count,
|
|
187
188
|
ROUND(SUM(revenue), 2) AS total_revenue,
|
|
188
189
|
ROUND(AVG(unit_price), 2) AS avg_price
|
|
189
|
-
FROM "{table_name}"
|
|
190
|
+
FROM "{namespace}"."{table_name}"
|
|
190
191
|
GROUP BY category
|
|
191
192
|
ORDER BY total_revenue DESC;
|
|
192
193
|
"""
|
|
@@ -126,7 +126,7 @@ MONTHLY_DEMAND_TABLE = "__MONTHLY_DEMAND_TABLE__"
|
|
|
126
126
|
|
|
127
127
|
response = client.olap.query(
|
|
128
128
|
project_id,
|
|
129
|
-
f'SELECT month, SUM(demand) AS total_demand FROM "{MONTHLY_DEMAND_TABLE}" GROUP BY month ORDER BY month ASC',
|
|
129
|
+
f'SELECT month, SUM(demand) AS total_demand FROM "proj_{project_id.replace("-", "_")}"."{MONTHLY_DEMAND_TABLE}" GROUP BY month ORDER BY month ASC',
|
|
130
130
|
)
|
|
131
131
|
client.close()
|
|
132
132
|
|
|
@@ -61,7 +61,8 @@ if not table_names:
|
|
|
61
61
|
|
|
62
62
|
# ── Step 4: Run an example query ────────────────────────────────────────
|
|
63
63
|
first_table = table_names[0]
|
|
64
|
-
|
|
64
|
+
namespace = f"proj_{project.id.replace('-', '_')}"
|
|
65
|
+
sql = f'SELECT * FROM "{namespace}"."{first_table}" LIMIT 5;'
|
|
65
66
|
|
|
66
67
|
print(f"\nPreview of '{first_table}' (first 5 rows):")
|
|
67
68
|
print(f" SQL: {sql}\n")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/generated_transport.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/models/__init__.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_analytics_v2.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_datasets_v2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/_workspace_v2.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/address_book.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/analytics.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/api_keys.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/attributes.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/categories.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/connections.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/cost_lists.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/dashboards.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/datasets.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/email.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/environments.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/erp_config.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/imports.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/inventory.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/issues.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/logistics.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/organizations.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/pricing.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/projects.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/purchasing.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/replenishment.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/sales.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/tasks.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/templates.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/usage.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/warehouses.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/worker_tasks.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/convexity_sdk/resources/workspace.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/018_shipment_document.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/019_fulfillment_document.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/compare_api_key_scopes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_org_and_project.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/create_single_project_api_key.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/001_check_crm_enabled.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/003_manage_customers.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/crm/004_manage_sales_reps.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/list_orgs_and_projects.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/purchasing/003_manage_vendors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/rbac/001_manage_roles.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/rbac/002_manage_assignments.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/rbac/003_verify_rbac_access.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/001_check_sales_enabled.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/002_enable_sales.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/005_manage_sales_orders.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/006_disable_sales.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/007_manage_customers.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/008_accept_sales_order.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/009_import_sales_order.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/011_close_sales_order.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/012_cancel_sales_order.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/sales/015_import_invoices.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/uci/003_seed_sales_from_uci.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev394 → convexity_sdk-0.21.0.dev397}/samples/uci/005_run_pipelines.py
RENAMED
|
File without changes
|
|
File without changes
|