structifyai 1.179.0__py3-none-any.whl → 1.182.0__py3-none-any.whl
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.
- structify/_base_client.py +5 -2
- structify/_compat.py +3 -3
- structify/_utils/_json.py +35 -0
- structify/_version.py +1 -1
- structify/resources/__init__.py +0 -2
- structify/resources/connector_catalog/admin.py +76 -0
- structify/resources/connectors/connectors.py +357 -1
- structify/resources/polars.py +2 -7
- structify/resources/sessions.py +83 -0
- structify/resources/slack.py +8 -8
- structify/resources/teams.py +12 -76
- structify/resources/wiki.py +22 -18
- structify/resources/workflow.py +7 -1
- structify/types/__init__.py +7 -3
- structify/types/admin/admin_sandbox.py +0 -2
- structify/types/{team_create_link_code_params.py → cell_edit_param.py} +7 -3
- structify/types/chat_create_session_params.py +2 -0
- structify/types/code_generate_code_params.py +2 -0
- structify/types/connector_add_schema_object_params.py +59 -0
- structify/types/connector_add_schema_object_response.py +35 -0
- structify/types/dashboard_component.py +7 -45
- structify/types/dashboard_component_param.py +8 -52
- structify/types/dashboard_page.py +3 -3
- structify/types/dashboard_page_param.py +3 -3
- structify/types/job_event_body.py +4 -0
- structify/types/llm_information_store.py +4 -0
- structify/types/parquet_edit_param.py +29 -0
- structify/types/session_edit_node_output_params.py +14 -0
- structify/types/session_edit_node_output_response.py +11 -0
- structify/types/slack_event_payload_param.py +2 -2
- structify/types/slack_events_params.py +2 -2
- structify/types/team_update_params.py +6 -0
- structify/types/usage_group_key.py +1 -0
- structify/types/user_info.py +4 -0
- structify/types/wiki_create_params.py +1 -2
- structify/types/wiki_list_response.py +2 -2
- structify/types/wiki_page.py +23 -0
- structify/types/wiki_page_with_references.py +2 -2
- structify/types/wiki_update_params.py +4 -2
- structify/types/workflow_run_params.py +3 -0
- structify/types/workflow_session_node.py +2 -0
- {structifyai-1.179.0.dist-info → structifyai-1.182.0.dist-info}/METADATA +1 -1
- {structifyai-1.179.0.dist-info → structifyai-1.182.0.dist-info}/RECORD +45 -42
- structify/resources/external.py +0 -99
- structify/resources/external_dataframe_proxy.py +0 -290
- structify/types/team_wiki_page.py +0 -28
- structify/types/teams_link_code_response.py +0 -13
- {structifyai-1.179.0.dist-info → structifyai-1.182.0.dist-info}/WHEEL +0 -0
- {structifyai-1.179.0.dist-info → structifyai-1.182.0.dist-info}/licenses/LICENSE +0 -0
structify/_base_client.py
CHANGED
|
@@ -86,6 +86,7 @@ from ._exceptions import (
|
|
|
86
86
|
APIConnectionError,
|
|
87
87
|
APIResponseValidationError,
|
|
88
88
|
)
|
|
89
|
+
from ._utils._json import openapi_dumps
|
|
89
90
|
|
|
90
91
|
log: logging.Logger = logging.getLogger(__name__)
|
|
91
92
|
|
|
@@ -554,8 +555,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
554
555
|
kwargs["content"] = options.content
|
|
555
556
|
elif isinstance(json_data, bytes):
|
|
556
557
|
kwargs["content"] = json_data
|
|
557
|
-
|
|
558
|
-
|
|
558
|
+
elif not files:
|
|
559
|
+
# Don't set content when JSON is sent as multipart/form-data,
|
|
560
|
+
# since httpx's content param overrides other body arguments
|
|
561
|
+
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
|
|
559
562
|
kwargs["files"] = files
|
|
560
563
|
else:
|
|
561
564
|
headers.pop("Content-Type", None)
|
structify/_compat.py
CHANGED
|
@@ -139,6 +139,7 @@ def model_dump(
|
|
|
139
139
|
exclude_defaults: bool = False,
|
|
140
140
|
warnings: bool = True,
|
|
141
141
|
mode: Literal["json", "python"] = "python",
|
|
142
|
+
by_alias: bool | None = None,
|
|
142
143
|
) -> dict[str, Any]:
|
|
143
144
|
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
144
145
|
return model.model_dump(
|
|
@@ -148,13 +149,12 @@ def model_dump(
|
|
|
148
149
|
exclude_defaults=exclude_defaults,
|
|
149
150
|
# warnings are not supported in Pydantic v1
|
|
150
151
|
warnings=True if PYDANTIC_V1 else warnings,
|
|
152
|
+
by_alias=by_alias,
|
|
151
153
|
)
|
|
152
154
|
return cast(
|
|
153
155
|
"dict[str, Any]",
|
|
154
156
|
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
155
|
-
exclude=exclude,
|
|
156
|
-
exclude_unset=exclude_unset,
|
|
157
|
-
exclude_defaults=exclude_defaults,
|
|
157
|
+
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
|
|
158
158
|
),
|
|
159
159
|
)
|
|
160
160
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing_extensions import override
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from .._compat import model_dump
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def openapi_dumps(obj: Any) -> bytes:
|
|
12
|
+
"""
|
|
13
|
+
Serialize an object to UTF-8 encoded JSON bytes.
|
|
14
|
+
|
|
15
|
+
Extends the standard json.dumps with support for additional types
|
|
16
|
+
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
|
|
17
|
+
"""
|
|
18
|
+
return json.dumps(
|
|
19
|
+
obj,
|
|
20
|
+
cls=_CustomEncoder,
|
|
21
|
+
# Uses the same defaults as httpx's JSON serialization
|
|
22
|
+
ensure_ascii=False,
|
|
23
|
+
separators=(",", ":"),
|
|
24
|
+
allow_nan=False,
|
|
25
|
+
).encode()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _CustomEncoder(json.JSONEncoder):
|
|
29
|
+
@override
|
|
30
|
+
def default(self, o: Any) -> Any:
|
|
31
|
+
if isinstance(o, datetime):
|
|
32
|
+
return o.isoformat()
|
|
33
|
+
if isinstance(o, pydantic.BaseModel):
|
|
34
|
+
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
|
|
35
|
+
return super().default(o)
|
structify/_version.py
CHANGED
structify/resources/__init__.py
CHANGED
|
@@ -133,7 +133,6 @@ from .entities import (
|
|
|
133
133
|
EntitiesResourceWithStreamingResponse,
|
|
134
134
|
AsyncEntitiesResourceWithStreamingResponse,
|
|
135
135
|
)
|
|
136
|
-
from .external import ExternalResource
|
|
137
136
|
from .projects import (
|
|
138
137
|
ProjectsResource,
|
|
139
138
|
AsyncProjectsResource,
|
|
@@ -357,7 +356,6 @@ __all__ = [
|
|
|
357
356
|
"PolarsResource",
|
|
358
357
|
"PolarsResourceWithRawResponse",
|
|
359
358
|
"PolarsResourceWithStreamingResponse",
|
|
360
|
-
"ExternalResource",
|
|
361
359
|
"PublicSessionsResource",
|
|
362
360
|
"AsyncPublicSessionsResource",
|
|
363
361
|
"PublicSessionsResourceWithRawResponse",
|
|
@@ -332,6 +332,38 @@ class AdminResource(SyncAPIResource):
|
|
|
332
332
|
cast_to=ConnectorAuthMethodScope,
|
|
333
333
|
)
|
|
334
334
|
|
|
335
|
+
def delete_catalog(
|
|
336
|
+
self,
|
|
337
|
+
id: str,
|
|
338
|
+
*,
|
|
339
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
340
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
341
|
+
extra_headers: Headers | None = None,
|
|
342
|
+
extra_query: Query | None = None,
|
|
343
|
+
extra_body: Body | None = None,
|
|
344
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
345
|
+
) -> None:
|
|
346
|
+
"""
|
|
347
|
+
Args:
|
|
348
|
+
extra_headers: Send extra headers
|
|
349
|
+
|
|
350
|
+
extra_query: Add additional query parameters to the request
|
|
351
|
+
|
|
352
|
+
extra_body: Add additional JSON properties to the request
|
|
353
|
+
|
|
354
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
355
|
+
"""
|
|
356
|
+
if not id:
|
|
357
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
358
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
359
|
+
return self._delete(
|
|
360
|
+
f"/admin/connector-catalog/{id}",
|
|
361
|
+
options=make_request_options(
|
|
362
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
363
|
+
),
|
|
364
|
+
cast_to=NoneType,
|
|
365
|
+
)
|
|
366
|
+
|
|
335
367
|
def delete_credential_field(
|
|
336
368
|
self,
|
|
337
369
|
id: str,
|
|
@@ -956,6 +988,38 @@ class AsyncAdminResource(AsyncAPIResource):
|
|
|
956
988
|
cast_to=ConnectorAuthMethodScope,
|
|
957
989
|
)
|
|
958
990
|
|
|
991
|
+
async def delete_catalog(
|
|
992
|
+
self,
|
|
993
|
+
id: str,
|
|
994
|
+
*,
|
|
995
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
996
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
997
|
+
extra_headers: Headers | None = None,
|
|
998
|
+
extra_query: Query | None = None,
|
|
999
|
+
extra_body: Body | None = None,
|
|
1000
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1001
|
+
) -> None:
|
|
1002
|
+
"""
|
|
1003
|
+
Args:
|
|
1004
|
+
extra_headers: Send extra headers
|
|
1005
|
+
|
|
1006
|
+
extra_query: Add additional query parameters to the request
|
|
1007
|
+
|
|
1008
|
+
extra_body: Add additional JSON properties to the request
|
|
1009
|
+
|
|
1010
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1011
|
+
"""
|
|
1012
|
+
if not id:
|
|
1013
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
1014
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1015
|
+
return await self._delete(
|
|
1016
|
+
f"/admin/connector-catalog/{id}",
|
|
1017
|
+
options=make_request_options(
|
|
1018
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1019
|
+
),
|
|
1020
|
+
cast_to=NoneType,
|
|
1021
|
+
)
|
|
1022
|
+
|
|
959
1023
|
async def delete_credential_field(
|
|
960
1024
|
self,
|
|
961
1025
|
id: str,
|
|
@@ -1328,6 +1392,9 @@ class AdminResourceWithRawResponse:
|
|
|
1328
1392
|
self.create_scope = to_raw_response_wrapper(
|
|
1329
1393
|
admin.create_scope,
|
|
1330
1394
|
)
|
|
1395
|
+
self.delete_catalog = to_raw_response_wrapper(
|
|
1396
|
+
admin.delete_catalog,
|
|
1397
|
+
)
|
|
1331
1398
|
self.delete_credential_field = to_raw_response_wrapper(
|
|
1332
1399
|
admin.delete_credential_field,
|
|
1333
1400
|
)
|
|
@@ -1379,6 +1446,9 @@ class AsyncAdminResourceWithRawResponse:
|
|
|
1379
1446
|
self.create_scope = async_to_raw_response_wrapper(
|
|
1380
1447
|
admin.create_scope,
|
|
1381
1448
|
)
|
|
1449
|
+
self.delete_catalog = async_to_raw_response_wrapper(
|
|
1450
|
+
admin.delete_catalog,
|
|
1451
|
+
)
|
|
1382
1452
|
self.delete_credential_field = async_to_raw_response_wrapper(
|
|
1383
1453
|
admin.delete_credential_field,
|
|
1384
1454
|
)
|
|
@@ -1430,6 +1500,9 @@ class AdminResourceWithStreamingResponse:
|
|
|
1430
1500
|
self.create_scope = to_streamed_response_wrapper(
|
|
1431
1501
|
admin.create_scope,
|
|
1432
1502
|
)
|
|
1503
|
+
self.delete_catalog = to_streamed_response_wrapper(
|
|
1504
|
+
admin.delete_catalog,
|
|
1505
|
+
)
|
|
1433
1506
|
self.delete_credential_field = to_streamed_response_wrapper(
|
|
1434
1507
|
admin.delete_credential_field,
|
|
1435
1508
|
)
|
|
@@ -1481,6 +1554,9 @@ class AsyncAdminResourceWithStreamingResponse:
|
|
|
1481
1554
|
self.create_scope = async_to_streamed_response_wrapper(
|
|
1482
1555
|
admin.create_scope,
|
|
1483
1556
|
)
|
|
1557
|
+
self.delete_catalog = async_to_streamed_response_wrapper(
|
|
1558
|
+
admin.delete_catalog,
|
|
1559
|
+
)
|
|
1484
1560
|
self.delete_credential_field = async_to_streamed_response_wrapper(
|
|
1485
1561
|
admin.delete_credential_field,
|
|
1486
1562
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Optional
|
|
5
|
+
from typing import Any, Dict, Optional, cast
|
|
6
6
|
from typing_extensions import Literal, overload
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
@@ -17,6 +17,7 @@ from ...types import (
|
|
|
17
17
|
connector_create_secret_params,
|
|
18
18
|
connector_search_tables_params,
|
|
19
19
|
connector_update_column_params,
|
|
20
|
+
connector_add_schema_object_params,
|
|
20
21
|
connector_get_explorer_chat_params,
|
|
21
22
|
connector_list_with_snippets_params,
|
|
22
23
|
connector_delete_schema_object_params,
|
|
@@ -53,6 +54,7 @@ from ...types.exploration_runs_response import ExplorationRunsResponse
|
|
|
53
54
|
from ...types.connector_summaries_response import ConnectorSummariesResponse
|
|
54
55
|
from ...types.delete_schema_object_response import DeleteSchemaObjectResponse
|
|
55
56
|
from ...types.connector_search_tables_response import ConnectorSearchTablesResponse
|
|
57
|
+
from ...types.connector_add_schema_object_response import ConnectorAddSchemaObjectResponse
|
|
56
58
|
from ...types.connector_list_with_snippets_response import ConnectorListWithSnippetsResponse
|
|
57
59
|
from ...types.connector_get_clarification_requests_response import ConnectorGetClarificationRequestsResponse
|
|
58
60
|
|
|
@@ -270,6 +272,177 @@ class ConnectorsResource(SyncAPIResource):
|
|
|
270
272
|
cast_to=NoneType,
|
|
271
273
|
)
|
|
272
274
|
|
|
275
|
+
@overload
|
|
276
|
+
def add_schema_object(
|
|
277
|
+
self,
|
|
278
|
+
connector_id: str,
|
|
279
|
+
*,
|
|
280
|
+
name: str,
|
|
281
|
+
type: Literal["database"],
|
|
282
|
+
description: Optional[str] | Omit = omit,
|
|
283
|
+
notes: Optional[str] | Omit = omit,
|
|
284
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
285
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
286
|
+
extra_headers: Headers | None = None,
|
|
287
|
+
extra_query: Query | None = None,
|
|
288
|
+
extra_body: Body | None = None,
|
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
290
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
291
|
+
"""
|
|
292
|
+
Args:
|
|
293
|
+
extra_headers: Send extra headers
|
|
294
|
+
|
|
295
|
+
extra_query: Add additional query parameters to the request
|
|
296
|
+
|
|
297
|
+
extra_body: Add additional JSON properties to the request
|
|
298
|
+
|
|
299
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
300
|
+
"""
|
|
301
|
+
...
|
|
302
|
+
|
|
303
|
+
@overload
|
|
304
|
+
def add_schema_object(
|
|
305
|
+
self,
|
|
306
|
+
connector_id: str,
|
|
307
|
+
*,
|
|
308
|
+
database_id: str,
|
|
309
|
+
name: str,
|
|
310
|
+
type: Literal["schema"],
|
|
311
|
+
description: Optional[str] | Omit = omit,
|
|
312
|
+
notes: Optional[str] | Omit = omit,
|
|
313
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
314
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
315
|
+
extra_headers: Headers | None = None,
|
|
316
|
+
extra_query: Query | None = None,
|
|
317
|
+
extra_body: Body | None = None,
|
|
318
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
319
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
320
|
+
"""
|
|
321
|
+
Args:
|
|
322
|
+
extra_headers: Send extra headers
|
|
323
|
+
|
|
324
|
+
extra_query: Add additional query parameters to the request
|
|
325
|
+
|
|
326
|
+
extra_body: Add additional JSON properties to the request
|
|
327
|
+
|
|
328
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
329
|
+
"""
|
|
330
|
+
...
|
|
331
|
+
|
|
332
|
+
@overload
|
|
333
|
+
def add_schema_object(
|
|
334
|
+
self,
|
|
335
|
+
connector_id: str,
|
|
336
|
+
*,
|
|
337
|
+
name: str,
|
|
338
|
+
schema_id: str,
|
|
339
|
+
type: Literal["table"],
|
|
340
|
+
description: Optional[str] | Omit = omit,
|
|
341
|
+
endpoint: Optional[str] | Omit = omit,
|
|
342
|
+
notes: Optional[str] | Omit = omit,
|
|
343
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
344
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
345
|
+
extra_headers: Headers | None = None,
|
|
346
|
+
extra_query: Query | None = None,
|
|
347
|
+
extra_body: Body | None = None,
|
|
348
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
349
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
350
|
+
"""
|
|
351
|
+
Args:
|
|
352
|
+
extra_headers: Send extra headers
|
|
353
|
+
|
|
354
|
+
extra_query: Add additional query parameters to the request
|
|
355
|
+
|
|
356
|
+
extra_body: Add additional JSON properties to the request
|
|
357
|
+
|
|
358
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
359
|
+
"""
|
|
360
|
+
...
|
|
361
|
+
|
|
362
|
+
@overload
|
|
363
|
+
def add_schema_object(
|
|
364
|
+
self,
|
|
365
|
+
connector_id: str,
|
|
366
|
+
*,
|
|
367
|
+
column_type: str,
|
|
368
|
+
name: str,
|
|
369
|
+
table_id: str,
|
|
370
|
+
type: Literal["column"],
|
|
371
|
+
notes: Optional[str] | Omit = omit,
|
|
372
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
373
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
374
|
+
extra_headers: Headers | None = None,
|
|
375
|
+
extra_query: Query | None = None,
|
|
376
|
+
extra_body: Body | None = None,
|
|
377
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
378
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
379
|
+
"""
|
|
380
|
+
Args:
|
|
381
|
+
extra_headers: Send extra headers
|
|
382
|
+
|
|
383
|
+
extra_query: Add additional query parameters to the request
|
|
384
|
+
|
|
385
|
+
extra_body: Add additional JSON properties to the request
|
|
386
|
+
|
|
387
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
388
|
+
"""
|
|
389
|
+
...
|
|
390
|
+
|
|
391
|
+
@required_args(
|
|
392
|
+
["name", "type"],
|
|
393
|
+
["database_id", "name", "type"],
|
|
394
|
+
["name", "schema_id", "type"],
|
|
395
|
+
["column_type", "name", "table_id", "type"],
|
|
396
|
+
)
|
|
397
|
+
def add_schema_object(
|
|
398
|
+
self,
|
|
399
|
+
connector_id: str,
|
|
400
|
+
*,
|
|
401
|
+
name: str,
|
|
402
|
+
type: Literal["database"] | Literal["schema"] | Literal["table"] | Literal["column"],
|
|
403
|
+
description: Optional[str] | Omit = omit,
|
|
404
|
+
notes: Optional[str] | Omit = omit,
|
|
405
|
+
database_id: str | Omit = omit,
|
|
406
|
+
schema_id: str | Omit = omit,
|
|
407
|
+
endpoint: Optional[str] | Omit = omit,
|
|
408
|
+
column_type: str | Omit = omit,
|
|
409
|
+
table_id: str | Omit = omit,
|
|
410
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
411
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
412
|
+
extra_headers: Headers | None = None,
|
|
413
|
+
extra_query: Query | None = None,
|
|
414
|
+
extra_body: Body | None = None,
|
|
415
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
416
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
417
|
+
if not connector_id:
|
|
418
|
+
raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
|
|
419
|
+
return cast(
|
|
420
|
+
ConnectorAddSchemaObjectResponse,
|
|
421
|
+
self._post(
|
|
422
|
+
f"/connectors/{connector_id}/schema_object",
|
|
423
|
+
body=maybe_transform(
|
|
424
|
+
{
|
|
425
|
+
"name": name,
|
|
426
|
+
"type": type,
|
|
427
|
+
"description": description,
|
|
428
|
+
"notes": notes,
|
|
429
|
+
"database_id": database_id,
|
|
430
|
+
"schema_id": schema_id,
|
|
431
|
+
"endpoint": endpoint,
|
|
432
|
+
"column_type": column_type,
|
|
433
|
+
"table_id": table_id,
|
|
434
|
+
},
|
|
435
|
+
connector_add_schema_object_params.ConnectorAddSchemaObjectParams,
|
|
436
|
+
),
|
|
437
|
+
options=make_request_options(
|
|
438
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
439
|
+
),
|
|
440
|
+
cast_to=cast(
|
|
441
|
+
Any, ConnectorAddSchemaObjectResponse
|
|
442
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
443
|
+
),
|
|
444
|
+
)
|
|
445
|
+
|
|
273
446
|
def create_secret(
|
|
274
447
|
self,
|
|
275
448
|
connector_id: str,
|
|
@@ -1207,6 +1380,177 @@ class AsyncConnectorsResource(AsyncAPIResource):
|
|
|
1207
1380
|
cast_to=NoneType,
|
|
1208
1381
|
)
|
|
1209
1382
|
|
|
1383
|
+
@overload
|
|
1384
|
+
async def add_schema_object(
|
|
1385
|
+
self,
|
|
1386
|
+
connector_id: str,
|
|
1387
|
+
*,
|
|
1388
|
+
name: str,
|
|
1389
|
+
type: Literal["database"],
|
|
1390
|
+
description: Optional[str] | Omit = omit,
|
|
1391
|
+
notes: Optional[str] | Omit = omit,
|
|
1392
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1393
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1394
|
+
extra_headers: Headers | None = None,
|
|
1395
|
+
extra_query: Query | None = None,
|
|
1396
|
+
extra_body: Body | None = None,
|
|
1397
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1398
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
1399
|
+
"""
|
|
1400
|
+
Args:
|
|
1401
|
+
extra_headers: Send extra headers
|
|
1402
|
+
|
|
1403
|
+
extra_query: Add additional query parameters to the request
|
|
1404
|
+
|
|
1405
|
+
extra_body: Add additional JSON properties to the request
|
|
1406
|
+
|
|
1407
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1408
|
+
"""
|
|
1409
|
+
...
|
|
1410
|
+
|
|
1411
|
+
@overload
|
|
1412
|
+
async def add_schema_object(
|
|
1413
|
+
self,
|
|
1414
|
+
connector_id: str,
|
|
1415
|
+
*,
|
|
1416
|
+
database_id: str,
|
|
1417
|
+
name: str,
|
|
1418
|
+
type: Literal["schema"],
|
|
1419
|
+
description: Optional[str] | Omit = omit,
|
|
1420
|
+
notes: Optional[str] | Omit = omit,
|
|
1421
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1422
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1423
|
+
extra_headers: Headers | None = None,
|
|
1424
|
+
extra_query: Query | None = None,
|
|
1425
|
+
extra_body: Body | None = None,
|
|
1426
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1427
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
1428
|
+
"""
|
|
1429
|
+
Args:
|
|
1430
|
+
extra_headers: Send extra headers
|
|
1431
|
+
|
|
1432
|
+
extra_query: Add additional query parameters to the request
|
|
1433
|
+
|
|
1434
|
+
extra_body: Add additional JSON properties to the request
|
|
1435
|
+
|
|
1436
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1437
|
+
"""
|
|
1438
|
+
...
|
|
1439
|
+
|
|
1440
|
+
@overload
|
|
1441
|
+
async def add_schema_object(
|
|
1442
|
+
self,
|
|
1443
|
+
connector_id: str,
|
|
1444
|
+
*,
|
|
1445
|
+
name: str,
|
|
1446
|
+
schema_id: str,
|
|
1447
|
+
type: Literal["table"],
|
|
1448
|
+
description: Optional[str] | Omit = omit,
|
|
1449
|
+
endpoint: Optional[str] | Omit = omit,
|
|
1450
|
+
notes: Optional[str] | Omit = omit,
|
|
1451
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1452
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1453
|
+
extra_headers: Headers | None = None,
|
|
1454
|
+
extra_query: Query | None = None,
|
|
1455
|
+
extra_body: Body | None = None,
|
|
1456
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1457
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
1458
|
+
"""
|
|
1459
|
+
Args:
|
|
1460
|
+
extra_headers: Send extra headers
|
|
1461
|
+
|
|
1462
|
+
extra_query: Add additional query parameters to the request
|
|
1463
|
+
|
|
1464
|
+
extra_body: Add additional JSON properties to the request
|
|
1465
|
+
|
|
1466
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1467
|
+
"""
|
|
1468
|
+
...
|
|
1469
|
+
|
|
1470
|
+
@overload
|
|
1471
|
+
async def add_schema_object(
|
|
1472
|
+
self,
|
|
1473
|
+
connector_id: str,
|
|
1474
|
+
*,
|
|
1475
|
+
column_type: str,
|
|
1476
|
+
name: str,
|
|
1477
|
+
table_id: str,
|
|
1478
|
+
type: Literal["column"],
|
|
1479
|
+
notes: Optional[str] | Omit = omit,
|
|
1480
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1481
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1482
|
+
extra_headers: Headers | None = None,
|
|
1483
|
+
extra_query: Query | None = None,
|
|
1484
|
+
extra_body: Body | None = None,
|
|
1485
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1486
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
1487
|
+
"""
|
|
1488
|
+
Args:
|
|
1489
|
+
extra_headers: Send extra headers
|
|
1490
|
+
|
|
1491
|
+
extra_query: Add additional query parameters to the request
|
|
1492
|
+
|
|
1493
|
+
extra_body: Add additional JSON properties to the request
|
|
1494
|
+
|
|
1495
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1496
|
+
"""
|
|
1497
|
+
...
|
|
1498
|
+
|
|
1499
|
+
@required_args(
|
|
1500
|
+
["name", "type"],
|
|
1501
|
+
["database_id", "name", "type"],
|
|
1502
|
+
["name", "schema_id", "type"],
|
|
1503
|
+
["column_type", "name", "table_id", "type"],
|
|
1504
|
+
)
|
|
1505
|
+
async def add_schema_object(
|
|
1506
|
+
self,
|
|
1507
|
+
connector_id: str,
|
|
1508
|
+
*,
|
|
1509
|
+
name: str,
|
|
1510
|
+
type: Literal["database"] | Literal["schema"] | Literal["table"] | Literal["column"],
|
|
1511
|
+
description: Optional[str] | Omit = omit,
|
|
1512
|
+
notes: Optional[str] | Omit = omit,
|
|
1513
|
+
database_id: str | Omit = omit,
|
|
1514
|
+
schema_id: str | Omit = omit,
|
|
1515
|
+
endpoint: Optional[str] | Omit = omit,
|
|
1516
|
+
column_type: str | Omit = omit,
|
|
1517
|
+
table_id: str | Omit = omit,
|
|
1518
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1519
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1520
|
+
extra_headers: Headers | None = None,
|
|
1521
|
+
extra_query: Query | None = None,
|
|
1522
|
+
extra_body: Body | None = None,
|
|
1523
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1524
|
+
) -> ConnectorAddSchemaObjectResponse:
|
|
1525
|
+
if not connector_id:
|
|
1526
|
+
raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
|
|
1527
|
+
return cast(
|
|
1528
|
+
ConnectorAddSchemaObjectResponse,
|
|
1529
|
+
await self._post(
|
|
1530
|
+
f"/connectors/{connector_id}/schema_object",
|
|
1531
|
+
body=await async_maybe_transform(
|
|
1532
|
+
{
|
|
1533
|
+
"name": name,
|
|
1534
|
+
"type": type,
|
|
1535
|
+
"description": description,
|
|
1536
|
+
"notes": notes,
|
|
1537
|
+
"database_id": database_id,
|
|
1538
|
+
"schema_id": schema_id,
|
|
1539
|
+
"endpoint": endpoint,
|
|
1540
|
+
"column_type": column_type,
|
|
1541
|
+
"table_id": table_id,
|
|
1542
|
+
},
|
|
1543
|
+
connector_add_schema_object_params.ConnectorAddSchemaObjectParams,
|
|
1544
|
+
),
|
|
1545
|
+
options=make_request_options(
|
|
1546
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1547
|
+
),
|
|
1548
|
+
cast_to=cast(
|
|
1549
|
+
Any, ConnectorAddSchemaObjectResponse
|
|
1550
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
1551
|
+
),
|
|
1552
|
+
)
|
|
1553
|
+
|
|
1210
1554
|
async def create_secret(
|
|
1211
1555
|
self,
|
|
1212
1556
|
connector_id: str,
|
|
@@ -1951,6 +2295,9 @@ class ConnectorsResourceWithRawResponse:
|
|
|
1951
2295
|
self.delete = to_raw_response_wrapper(
|
|
1952
2296
|
connectors.delete,
|
|
1953
2297
|
)
|
|
2298
|
+
self.add_schema_object = to_raw_response_wrapper(
|
|
2299
|
+
connectors.add_schema_object,
|
|
2300
|
+
)
|
|
1954
2301
|
self.create_secret = to_raw_response_wrapper(
|
|
1955
2302
|
connectors.create_secret,
|
|
1956
2303
|
)
|
|
@@ -2024,6 +2371,9 @@ class AsyncConnectorsResourceWithRawResponse:
|
|
|
2024
2371
|
self.delete = async_to_raw_response_wrapper(
|
|
2025
2372
|
connectors.delete,
|
|
2026
2373
|
)
|
|
2374
|
+
self.add_schema_object = async_to_raw_response_wrapper(
|
|
2375
|
+
connectors.add_schema_object,
|
|
2376
|
+
)
|
|
2027
2377
|
self.create_secret = async_to_raw_response_wrapper(
|
|
2028
2378
|
connectors.create_secret,
|
|
2029
2379
|
)
|
|
@@ -2097,6 +2447,9 @@ class ConnectorsResourceWithStreamingResponse:
|
|
|
2097
2447
|
self.delete = to_streamed_response_wrapper(
|
|
2098
2448
|
connectors.delete,
|
|
2099
2449
|
)
|
|
2450
|
+
self.add_schema_object = to_streamed_response_wrapper(
|
|
2451
|
+
connectors.add_schema_object,
|
|
2452
|
+
)
|
|
2100
2453
|
self.create_secret = to_streamed_response_wrapper(
|
|
2101
2454
|
connectors.create_secret,
|
|
2102
2455
|
)
|
|
@@ -2170,6 +2523,9 @@ class AsyncConnectorsResourceWithStreamingResponse:
|
|
|
2170
2523
|
self.delete = async_to_streamed_response_wrapper(
|
|
2171
2524
|
connectors.delete,
|
|
2172
2525
|
)
|
|
2526
|
+
self.add_schema_object = async_to_streamed_response_wrapper(
|
|
2527
|
+
connectors.add_schema_object,
|
|
2528
|
+
)
|
|
2173
2529
|
self.create_secret = async_to_streamed_response_wrapper(
|
|
2174
2530
|
connectors.create_secret,
|
|
2175
2531
|
)
|
structify/resources/polars.py
CHANGED
|
@@ -26,7 +26,6 @@ from .._response import (
|
|
|
26
26
|
)
|
|
27
27
|
from ..types.table_param import Property
|
|
28
28
|
from ..lib.cost_confirmation import request_cost_confirmation_if_needed
|
|
29
|
-
from .external_dataframe_proxy import ServicesProxy
|
|
30
29
|
from ..types.save_requirement_param import RequiredEntity, RequiredProperty
|
|
31
30
|
from ..types.dataset_descriptor_param import DatasetDescriptorParam
|
|
32
31
|
from ..types.structure_run_async_params import SourceWebWeb
|
|
@@ -48,11 +47,6 @@ def _collect_entities_with_job_ids(entities: Any) -> List[Dict[str, Any]]:
|
|
|
48
47
|
|
|
49
48
|
|
|
50
49
|
class PolarsResource(SyncAPIResource):
|
|
51
|
-
@cached_property
|
|
52
|
-
def external(self) -> ServicesProxy:
|
|
53
|
-
"""Access external whitelabel services with DataFrame batch processing."""
|
|
54
|
-
return ServicesProxy(self._client)
|
|
55
|
-
|
|
56
50
|
@cached_property
|
|
57
51
|
def with_raw_response(self) -> PolarsResourceWithRawResponse:
|
|
58
52
|
"""
|
|
@@ -1130,7 +1124,8 @@ class PolarsResource(SyncAPIResource):
|
|
|
1130
1124
|
while True:
|
|
1131
1125
|
remaining_embeddings = self._client.datasets.count_missing_embeddings(name=dataset_name).count
|
|
1132
1126
|
count_history.append(remaining_embeddings)
|
|
1133
|
-
tqdm_marker.
|
|
1127
|
+
tqdm_marker.n = total_embeddings - remaining_embeddings
|
|
1128
|
+
tqdm_marker.refresh()
|
|
1134
1129
|
if remaining_embeddings == 0:
|
|
1135
1130
|
break
|
|
1136
1131
|
# If we haven't updated any entities in a while, consider the embeddings as not updating and break
|