robosystems-client 0.2.2__py3-none-any.whl → 0.2.3__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.

Potentially problematic release.


This version of robosystems-client might be problematic. Click here for more details.

Files changed (34) hide show
  1. robosystems_client/api/query/execute_cypher_query.py +0 -5
  2. robosystems_client/api/tables/delete_file.py +437 -0
  3. robosystems_client/api/tables/get_file_info.py +397 -0
  4. robosystems_client/api/tables/get_upload_url.py +548 -0
  5. robosystems_client/api/tables/ingest_tables.py +616 -0
  6. robosystems_client/api/tables/list_table_files.py +509 -0
  7. robosystems_client/api/tables/list_tables.py +488 -0
  8. robosystems_client/api/tables/query_tables.py +487 -0
  9. robosystems_client/api/tables/update_file_status.py +539 -0
  10. robosystems_client/extensions/graph_client.py +5 -0
  11. robosystems_client/extensions/table_ingest_client.py +31 -40
  12. robosystems_client/models/__init__.py +13 -17
  13. robosystems_client/models/create_graph_request.py +11 -0
  14. robosystems_client/models/{delete_file_v1_graphs_graph_id_tables_files_file_id_delete_response_delete_file_v1_graphs_graph_id_tables_files_file_id_delete.py → delete_file_response.py} +45 -9
  15. robosystems_client/models/file_info.py +169 -0
  16. robosystems_client/models/file_status_update.py +41 -0
  17. robosystems_client/models/get_file_info_response.py +205 -0
  18. robosystems_client/models/list_table_files_response.py +105 -0
  19. robosystems_client/models/{get_file_info_v1_graphs_graph_id_tables_files_file_id_get_response_get_file_info_v1_graphs_graph_id_tables_files_file_id_get.py → update_file_status_response_updatefilestatus.py} +5 -8
  20. {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.3.dist-info}/METADATA +1 -1
  21. {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.3.dist-info}/RECORD +23 -22
  22. robosystems_client/api/tables/delete_file_v1_graphs_graph_id_tables_files_file_id_delete.py +0 -287
  23. robosystems_client/api/tables/get_file_info_v1_graphs_graph_id_tables_files_file_id_get.py +0 -283
  24. robosystems_client/api/tables/get_upload_url_v1_graphs_graph_id_tables_table_name_files_post.py +0 -260
  25. robosystems_client/api/tables/ingest_tables_v1_graphs_graph_id_tables_ingest_post.py +0 -251
  26. robosystems_client/api/tables/list_table_files_v1_graphs_graph_id_tables_table_name_files_get.py +0 -283
  27. robosystems_client/api/tables/list_tables_v1_graphs_graph_id_tables_get.py +0 -224
  28. robosystems_client/api/tables/query_tables_v1_graphs_graph_id_tables_query_post.py +0 -247
  29. robosystems_client/api/tables/update_file_v1_graphs_graph_id_tables_files_file_id_patch.py +0 -306
  30. robosystems_client/models/file_update_request.py +0 -62
  31. robosystems_client/models/list_table_files_v1_graphs_graph_id_tables_table_name_files_get_response_list_table_files_v1_graphs_graph_id_tables_table_name_files_get.py +0 -47
  32. robosystems_client/models/update_file_v1_graphs_graph_id_tables_files_file_id_patch_response_update_file_v1_graphs_graph_id_tables_files_file_id_patch.py +0 -47
  33. {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.3.dist-info}/WHEEL +0 -0
  34. {robosystems_client-0.2.2.dist-info → robosystems_client-0.2.3.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,488 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.table_list_response import TableListResponse
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ graph_id: str,
16
+ *,
17
+ token: Union[None, Unset, str] = UNSET,
18
+ authorization: Union[None, Unset, str] = UNSET,
19
+ ) -> dict[str, Any]:
20
+ headers: dict[str, Any] = {}
21
+ if not isinstance(authorization, Unset):
22
+ headers["authorization"] = authorization
23
+
24
+ params: dict[str, Any] = {}
25
+
26
+ json_token: Union[None, Unset, str]
27
+ if isinstance(token, Unset):
28
+ json_token = UNSET
29
+ else:
30
+ json_token = token
31
+ params["token"] = json_token
32
+
33
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
34
+
35
+ _kwargs: dict[str, Any] = {
36
+ "method": "get",
37
+ "url": f"/v1/graphs/{graph_id}/tables",
38
+ "params": params,
39
+ }
40
+
41
+ _kwargs["headers"] = headers
42
+ return _kwargs
43
+
44
+
45
+ def _parse_response(
46
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
47
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]:
48
+ if response.status_code == 200:
49
+ response_200 = TableListResponse.from_dict(response.json())
50
+
51
+ return response_200
52
+
53
+ if response.status_code == 401:
54
+ response_401 = cast(Any, None)
55
+ return response_401
56
+
57
+ if response.status_code == 403:
58
+ response_403 = ErrorResponse.from_dict(response.json())
59
+
60
+ return response_403
61
+
62
+ if response.status_code == 404:
63
+ response_404 = ErrorResponse.from_dict(response.json())
64
+
65
+ return response_404
66
+
67
+ if response.status_code == 422:
68
+ response_422 = HTTPValidationError.from_dict(response.json())
69
+
70
+ return response_422
71
+
72
+ if response.status_code == 500:
73
+ response_500 = cast(Any, None)
74
+ return response_500
75
+
76
+ if client.raise_on_unexpected_status:
77
+ raise errors.UnexpectedStatus(response.status_code, response.content)
78
+ else:
79
+ return None
80
+
81
+
82
+ def _build_response(
83
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
84
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]:
85
+ return Response(
86
+ status_code=HTTPStatus(response.status_code),
87
+ content=response.content,
88
+ headers=response.headers,
89
+ parsed=_parse_response(client=client, response=response),
90
+ )
91
+
92
+
93
+ def sync_detailed(
94
+ graph_id: str,
95
+ *,
96
+ client: AuthenticatedClient,
97
+ token: Union[None, Unset, str] = UNSET,
98
+ authorization: Union[None, Unset, str] = UNSET,
99
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]:
100
+ r""" List Staging Tables
101
+
102
+ List all DuckDB staging tables with comprehensive metrics and status.
103
+
104
+ **Purpose:**
105
+ Get a complete inventory of all staging tables for a graph, including
106
+ file counts, storage sizes, and row estimates. Essential for monitoring
107
+ the data pipeline and determining which tables are ready for ingestion.
108
+
109
+ **What You Get:**
110
+ - Table name and type (node/relationship)
111
+ - File count per table
112
+ - Total storage size in bytes
113
+ - Estimated row count
114
+ - S3 location pattern
115
+ - Ready-for-ingestion status
116
+
117
+ **Use Cases:**
118
+ - Monitor data upload progress
119
+ - Check which tables have files ready
120
+ - Track storage consumption
121
+ - Validate pipeline before ingestion
122
+ - Capacity planning
123
+
124
+ **Workflow:**
125
+ 1. List tables to see current state
126
+ 2. Upload files to empty tables
127
+ 3. Re-list to verify uploads
128
+ 4. Check file counts and sizes
129
+ 5. Ingest when ready
130
+
131
+ **Example Response:**
132
+ ```json
133
+ {
134
+ \"tables\": [
135
+ {
136
+ \"table_name\": \"Entity\",
137
+ \"row_count\": 5000,
138
+ \"file_count\": 3,
139
+ \"total_size_bytes\": 2457600,
140
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Entity/**/*.parquet\"
141
+ },
142
+ {
143
+ \"table_name\": \"Transaction\",
144
+ \"row_count\": 15000,
145
+ \"file_count\": 5,
146
+ \"total_size_bytes\": 8192000,
147
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Transaction/**/*.parquet\"
148
+ }
149
+ ],
150
+ \"total_count\": 2
151
+ }
152
+ ```
153
+
154
+ **Example Usage:**
155
+ ```bash
156
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
157
+ https://api.robosystems.ai/v1/graphs/kg123/tables
158
+ ```
159
+
160
+ **Tips:**
161
+ - Tables with `file_count > 0` have data ready
162
+ - Check `total_size_bytes` for storage monitoring
163
+ - Use `s3_location` to verify upload paths
164
+ - Empty tables (file_count=0) are skipped during ingestion
165
+
166
+ **Note:**
167
+ Table queries are included - no credit consumption.
168
+
169
+ Args:
170
+ graph_id (str): Graph database identifier
171
+ token (Union[None, Unset, str]): JWT token for SSE authentication
172
+ authorization (Union[None, Unset, str]):
173
+
174
+ Raises:
175
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
176
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
177
+
178
+ Returns:
179
+ Response[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]
180
+ """
181
+
182
+ kwargs = _get_kwargs(
183
+ graph_id=graph_id,
184
+ token=token,
185
+ authorization=authorization,
186
+ )
187
+
188
+ response = client.get_httpx_client().request(
189
+ **kwargs,
190
+ )
191
+
192
+ return _build_response(client=client, response=response)
193
+
194
+
195
+ def sync(
196
+ graph_id: str,
197
+ *,
198
+ client: AuthenticatedClient,
199
+ token: Union[None, Unset, str] = UNSET,
200
+ authorization: Union[None, Unset, str] = UNSET,
201
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]:
202
+ r""" List Staging Tables
203
+
204
+ List all DuckDB staging tables with comprehensive metrics and status.
205
+
206
+ **Purpose:**
207
+ Get a complete inventory of all staging tables for a graph, including
208
+ file counts, storage sizes, and row estimates. Essential for monitoring
209
+ the data pipeline and determining which tables are ready for ingestion.
210
+
211
+ **What You Get:**
212
+ - Table name and type (node/relationship)
213
+ - File count per table
214
+ - Total storage size in bytes
215
+ - Estimated row count
216
+ - S3 location pattern
217
+ - Ready-for-ingestion status
218
+
219
+ **Use Cases:**
220
+ - Monitor data upload progress
221
+ - Check which tables have files ready
222
+ - Track storage consumption
223
+ - Validate pipeline before ingestion
224
+ - Capacity planning
225
+
226
+ **Workflow:**
227
+ 1. List tables to see current state
228
+ 2. Upload files to empty tables
229
+ 3. Re-list to verify uploads
230
+ 4. Check file counts and sizes
231
+ 5. Ingest when ready
232
+
233
+ **Example Response:**
234
+ ```json
235
+ {
236
+ \"tables\": [
237
+ {
238
+ \"table_name\": \"Entity\",
239
+ \"row_count\": 5000,
240
+ \"file_count\": 3,
241
+ \"total_size_bytes\": 2457600,
242
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Entity/**/*.parquet\"
243
+ },
244
+ {
245
+ \"table_name\": \"Transaction\",
246
+ \"row_count\": 15000,
247
+ \"file_count\": 5,
248
+ \"total_size_bytes\": 8192000,
249
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Transaction/**/*.parquet\"
250
+ }
251
+ ],
252
+ \"total_count\": 2
253
+ }
254
+ ```
255
+
256
+ **Example Usage:**
257
+ ```bash
258
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
259
+ https://api.robosystems.ai/v1/graphs/kg123/tables
260
+ ```
261
+
262
+ **Tips:**
263
+ - Tables with `file_count > 0` have data ready
264
+ - Check `total_size_bytes` for storage monitoring
265
+ - Use `s3_location` to verify upload paths
266
+ - Empty tables (file_count=0) are skipped during ingestion
267
+
268
+ **Note:**
269
+ Table queries are included - no credit consumption.
270
+
271
+ Args:
272
+ graph_id (str): Graph database identifier
273
+ token (Union[None, Unset, str]): JWT token for SSE authentication
274
+ authorization (Union[None, Unset, str]):
275
+
276
+ Raises:
277
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
278
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
279
+
280
+ Returns:
281
+ Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]
282
+ """
283
+
284
+ return sync_detailed(
285
+ graph_id=graph_id,
286
+ client=client,
287
+ token=token,
288
+ authorization=authorization,
289
+ ).parsed
290
+
291
+
292
+ async def asyncio_detailed(
293
+ graph_id: str,
294
+ *,
295
+ client: AuthenticatedClient,
296
+ token: Union[None, Unset, str] = UNSET,
297
+ authorization: Union[None, Unset, str] = UNSET,
298
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]:
299
+ r""" List Staging Tables
300
+
301
+ List all DuckDB staging tables with comprehensive metrics and status.
302
+
303
+ **Purpose:**
304
+ Get a complete inventory of all staging tables for a graph, including
305
+ file counts, storage sizes, and row estimates. Essential for monitoring
306
+ the data pipeline and determining which tables are ready for ingestion.
307
+
308
+ **What You Get:**
309
+ - Table name and type (node/relationship)
310
+ - File count per table
311
+ - Total storage size in bytes
312
+ - Estimated row count
313
+ - S3 location pattern
314
+ - Ready-for-ingestion status
315
+
316
+ **Use Cases:**
317
+ - Monitor data upload progress
318
+ - Check which tables have files ready
319
+ - Track storage consumption
320
+ - Validate pipeline before ingestion
321
+ - Capacity planning
322
+
323
+ **Workflow:**
324
+ 1. List tables to see current state
325
+ 2. Upload files to empty tables
326
+ 3. Re-list to verify uploads
327
+ 4. Check file counts and sizes
328
+ 5. Ingest when ready
329
+
330
+ **Example Response:**
331
+ ```json
332
+ {
333
+ \"tables\": [
334
+ {
335
+ \"table_name\": \"Entity\",
336
+ \"row_count\": 5000,
337
+ \"file_count\": 3,
338
+ \"total_size_bytes\": 2457600,
339
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Entity/**/*.parquet\"
340
+ },
341
+ {
342
+ \"table_name\": \"Transaction\",
343
+ \"row_count\": 15000,
344
+ \"file_count\": 5,
345
+ \"total_size_bytes\": 8192000,
346
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Transaction/**/*.parquet\"
347
+ }
348
+ ],
349
+ \"total_count\": 2
350
+ }
351
+ ```
352
+
353
+ **Example Usage:**
354
+ ```bash
355
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
356
+ https://api.robosystems.ai/v1/graphs/kg123/tables
357
+ ```
358
+
359
+ **Tips:**
360
+ - Tables with `file_count > 0` have data ready
361
+ - Check `total_size_bytes` for storage monitoring
362
+ - Use `s3_location` to verify upload paths
363
+ - Empty tables (file_count=0) are skipped during ingestion
364
+
365
+ **Note:**
366
+ Table queries are included - no credit consumption.
367
+
368
+ Args:
369
+ graph_id (str): Graph database identifier
370
+ token (Union[None, Unset, str]): JWT token for SSE authentication
371
+ authorization (Union[None, Unset, str]):
372
+
373
+ Raises:
374
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
375
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
376
+
377
+ Returns:
378
+ Response[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]
379
+ """
380
+
381
+ kwargs = _get_kwargs(
382
+ graph_id=graph_id,
383
+ token=token,
384
+ authorization=authorization,
385
+ )
386
+
387
+ response = await client.get_async_httpx_client().request(**kwargs)
388
+
389
+ return _build_response(client=client, response=response)
390
+
391
+
392
+ async def asyncio(
393
+ graph_id: str,
394
+ *,
395
+ client: AuthenticatedClient,
396
+ token: Union[None, Unset, str] = UNSET,
397
+ authorization: Union[None, Unset, str] = UNSET,
398
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]]:
399
+ r""" List Staging Tables
400
+
401
+ List all DuckDB staging tables with comprehensive metrics and status.
402
+
403
+ **Purpose:**
404
+ Get a complete inventory of all staging tables for a graph, including
405
+ file counts, storage sizes, and row estimates. Essential for monitoring
406
+ the data pipeline and determining which tables are ready for ingestion.
407
+
408
+ **What You Get:**
409
+ - Table name and type (node/relationship)
410
+ - File count per table
411
+ - Total storage size in bytes
412
+ - Estimated row count
413
+ - S3 location pattern
414
+ - Ready-for-ingestion status
415
+
416
+ **Use Cases:**
417
+ - Monitor data upload progress
418
+ - Check which tables have files ready
419
+ - Track storage consumption
420
+ - Validate pipeline before ingestion
421
+ - Capacity planning
422
+
423
+ **Workflow:**
424
+ 1. List tables to see current state
425
+ 2. Upload files to empty tables
426
+ 3. Re-list to verify uploads
427
+ 4. Check file counts and sizes
428
+ 5. Ingest when ready
429
+
430
+ **Example Response:**
431
+ ```json
432
+ {
433
+ \"tables\": [
434
+ {
435
+ \"table_name\": \"Entity\",
436
+ \"row_count\": 5000,
437
+ \"file_count\": 3,
438
+ \"total_size_bytes\": 2457600,
439
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Entity/**/*.parquet\"
440
+ },
441
+ {
442
+ \"table_name\": \"Transaction\",
443
+ \"row_count\": 15000,
444
+ \"file_count\": 5,
445
+ \"total_size_bytes\": 8192000,
446
+ \"s3_location\": \"s3://bucket/user-staging/user123/graph456/Transaction/**/*.parquet\"
447
+ }
448
+ ],
449
+ \"total_count\": 2
450
+ }
451
+ ```
452
+
453
+ **Example Usage:**
454
+ ```bash
455
+ curl -H \"Authorization: Bearer YOUR_TOKEN\" \
456
+ https://api.robosystems.ai/v1/graphs/kg123/tables
457
+ ```
458
+
459
+ **Tips:**
460
+ - Tables with `file_count > 0` have data ready
461
+ - Check `total_size_bytes` for storage monitoring
462
+ - Use `s3_location` to verify upload paths
463
+ - Empty tables (file_count=0) are skipped during ingestion
464
+
465
+ **Note:**
466
+ Table queries are included - no credit consumption.
467
+
468
+ Args:
469
+ graph_id (str): Graph database identifier
470
+ token (Union[None, Unset, str]): JWT token for SSE authentication
471
+ authorization (Union[None, Unset, str]):
472
+
473
+ Raises:
474
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
475
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
476
+
477
+ Returns:
478
+ Union[Any, ErrorResponse, HTTPValidationError, TableListResponse]
479
+ """
480
+
481
+ return (
482
+ await asyncio_detailed(
483
+ graph_id=graph_id,
484
+ client=client,
485
+ token=token,
486
+ authorization=authorization,
487
+ )
488
+ ).parsed