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
@@ -67,11 +67,6 @@ def _parse_response(
67
67
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
68
68
  ) -> Optional[Union[Any, HTTPValidationError]]:
69
69
  if response.status_code == 200:
70
- # Check if this is NDJSON - if so, skip parsing (will be handled by client)
71
- content_type = response.headers.get("content-type", "")
72
- stream_format = response.headers.get("x-stream-format", "")
73
- if "application/x-ndjson" in content_type or stream_format == "ndjson":
74
- return None # Skip parsing, client will handle NDJSON
75
70
  response_200 = response.json()
76
71
  return response_200
77
72
 
@@ -0,0 +1,437 @@
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.delete_file_response import DeleteFileResponse
9
+ from ...models.error_response import ErrorResponse
10
+ from ...models.http_validation_error import HTTPValidationError
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ graph_id: str,
16
+ file_id: str,
17
+ *,
18
+ token: Union[None, Unset, str] = UNSET,
19
+ authorization: Union[None, Unset, str] = UNSET,
20
+ ) -> dict[str, Any]:
21
+ headers: dict[str, Any] = {}
22
+ if not isinstance(authorization, Unset):
23
+ headers["authorization"] = authorization
24
+
25
+ params: dict[str, Any] = {}
26
+
27
+ json_token: Union[None, Unset, str]
28
+ if isinstance(token, Unset):
29
+ json_token = UNSET
30
+ else:
31
+ json_token = token
32
+ params["token"] = json_token
33
+
34
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
35
+
36
+ _kwargs: dict[str, Any] = {
37
+ "method": "delete",
38
+ "url": f"/v1/graphs/{graph_id}/tables/files/{file_id}",
39
+ "params": params,
40
+ }
41
+
42
+ _kwargs["headers"] = headers
43
+ return _kwargs
44
+
45
+
46
+ def _parse_response(
47
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
48
+ ) -> Optional[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]:
49
+ if response.status_code == 200:
50
+ response_200 = DeleteFileResponse.from_dict(response.json())
51
+
52
+ return response_200
53
+
54
+ if response.status_code == 401:
55
+ response_401 = cast(Any, None)
56
+ return response_401
57
+
58
+ if response.status_code == 403:
59
+ response_403 = ErrorResponse.from_dict(response.json())
60
+
61
+ return response_403
62
+
63
+ if response.status_code == 404:
64
+ response_404 = ErrorResponse.from_dict(response.json())
65
+
66
+ return response_404
67
+
68
+ if response.status_code == 422:
69
+ response_422 = HTTPValidationError.from_dict(response.json())
70
+
71
+ return response_422
72
+
73
+ if response.status_code == 500:
74
+ response_500 = cast(Any, None)
75
+ return response_500
76
+
77
+ if client.raise_on_unexpected_status:
78
+ raise errors.UnexpectedStatus(response.status_code, response.content)
79
+ else:
80
+ return None
81
+
82
+
83
+ def _build_response(
84
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
85
+ ) -> Response[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]:
86
+ return Response(
87
+ status_code=HTTPStatus(response.status_code),
88
+ content=response.content,
89
+ headers=response.headers,
90
+ parsed=_parse_response(client=client, response=response),
91
+ )
92
+
93
+
94
+ def sync_detailed(
95
+ graph_id: str,
96
+ file_id: str,
97
+ *,
98
+ client: AuthenticatedClient,
99
+ token: Union[None, Unset, str] = UNSET,
100
+ authorization: Union[None, Unset, str] = UNSET,
101
+ ) -> Response[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]:
102
+ r""" Delete File from Staging
103
+
104
+ Delete a file from S3 storage and database tracking.
105
+
106
+ **Purpose:**
107
+ Remove unwanted, duplicate, or incorrect files from staging tables before ingestion.
108
+ The file is deleted from both S3 and database tracking, and table statistics
109
+ are automatically recalculated.
110
+
111
+ **Use Cases:**
112
+ - Remove duplicate uploads
113
+ - Delete files with incorrect data
114
+ - Clean up failed uploads
115
+ - Fix data quality issues before ingestion
116
+ - Manage storage usage
117
+
118
+ **What Happens:**
119
+ 1. File deleted from S3 storage
120
+ 2. Database tracking record removed
121
+ 3. Table statistics recalculated (file count, size, row count)
122
+ 4. DuckDB automatically excludes file from future queries
123
+
124
+ **Security:**
125
+ - Write access required (verified via auth)
126
+ - Shared repositories block file deletions
127
+ - Full audit trail of deletion operations
128
+ - Cannot delete after ingestion to graph
129
+
130
+ **Example Response:**
131
+ ```json
132
+ {
133
+ \"status\": \"deleted\",
134
+ \"file_id\": \"f123\",
135
+ \"file_name\": \"entities_batch1.parquet\",
136
+ \"message\": \"File deleted successfully. DuckDB will automatically exclude it from queries.\"
137
+ }
138
+ ```
139
+
140
+ **Example Usage:**
141
+ ```bash
142
+ curl -X DELETE -H \"Authorization: Bearer YOUR_TOKEN\" \
143
+ https://api.robosystems.ai/v1/graphs/kg123/tables/files/f123
144
+ ```
145
+
146
+ **Tips:**
147
+ - Delete files before ingestion for best results
148
+ - Table statistics update automatically
149
+ - No need to refresh DuckDB - exclusion is automatic
150
+ - Consider re-uploading corrected version after deletion
151
+
152
+ **Note:**
153
+ File deletion is included - no credit consumption.
154
+
155
+ Args:
156
+ graph_id (str): Graph database identifier
157
+ file_id (str): File ID
158
+ token (Union[None, Unset, str]): JWT token for SSE authentication
159
+ authorization (Union[None, Unset, str]):
160
+
161
+ Raises:
162
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
163
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
164
+
165
+ Returns:
166
+ Response[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]
167
+ """
168
+
169
+ kwargs = _get_kwargs(
170
+ graph_id=graph_id,
171
+ file_id=file_id,
172
+ token=token,
173
+ authorization=authorization,
174
+ )
175
+
176
+ response = client.get_httpx_client().request(
177
+ **kwargs,
178
+ )
179
+
180
+ return _build_response(client=client, response=response)
181
+
182
+
183
+ def sync(
184
+ graph_id: str,
185
+ file_id: str,
186
+ *,
187
+ client: AuthenticatedClient,
188
+ token: Union[None, Unset, str] = UNSET,
189
+ authorization: Union[None, Unset, str] = UNSET,
190
+ ) -> Optional[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]:
191
+ r""" Delete File from Staging
192
+
193
+ Delete a file from S3 storage and database tracking.
194
+
195
+ **Purpose:**
196
+ Remove unwanted, duplicate, or incorrect files from staging tables before ingestion.
197
+ The file is deleted from both S3 and database tracking, and table statistics
198
+ are automatically recalculated.
199
+
200
+ **Use Cases:**
201
+ - Remove duplicate uploads
202
+ - Delete files with incorrect data
203
+ - Clean up failed uploads
204
+ - Fix data quality issues before ingestion
205
+ - Manage storage usage
206
+
207
+ **What Happens:**
208
+ 1. File deleted from S3 storage
209
+ 2. Database tracking record removed
210
+ 3. Table statistics recalculated (file count, size, row count)
211
+ 4. DuckDB automatically excludes file from future queries
212
+
213
+ **Security:**
214
+ - Write access required (verified via auth)
215
+ - Shared repositories block file deletions
216
+ - Full audit trail of deletion operations
217
+ - Cannot delete after ingestion to graph
218
+
219
+ **Example Response:**
220
+ ```json
221
+ {
222
+ \"status\": \"deleted\",
223
+ \"file_id\": \"f123\",
224
+ \"file_name\": \"entities_batch1.parquet\",
225
+ \"message\": \"File deleted successfully. DuckDB will automatically exclude it from queries.\"
226
+ }
227
+ ```
228
+
229
+ **Example Usage:**
230
+ ```bash
231
+ curl -X DELETE -H \"Authorization: Bearer YOUR_TOKEN\" \
232
+ https://api.robosystems.ai/v1/graphs/kg123/tables/files/f123
233
+ ```
234
+
235
+ **Tips:**
236
+ - Delete files before ingestion for best results
237
+ - Table statistics update automatically
238
+ - No need to refresh DuckDB - exclusion is automatic
239
+ - Consider re-uploading corrected version after deletion
240
+
241
+ **Note:**
242
+ File deletion is included - no credit consumption.
243
+
244
+ Args:
245
+ graph_id (str): Graph database identifier
246
+ file_id (str): File ID
247
+ token (Union[None, Unset, str]): JWT token for SSE authentication
248
+ authorization (Union[None, Unset, str]):
249
+
250
+ Raises:
251
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
252
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
253
+
254
+ Returns:
255
+ Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]
256
+ """
257
+
258
+ return sync_detailed(
259
+ graph_id=graph_id,
260
+ file_id=file_id,
261
+ client=client,
262
+ token=token,
263
+ authorization=authorization,
264
+ ).parsed
265
+
266
+
267
+ async def asyncio_detailed(
268
+ graph_id: str,
269
+ file_id: str,
270
+ *,
271
+ client: AuthenticatedClient,
272
+ token: Union[None, Unset, str] = UNSET,
273
+ authorization: Union[None, Unset, str] = UNSET,
274
+ ) -> Response[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]:
275
+ r""" Delete File from Staging
276
+
277
+ Delete a file from S3 storage and database tracking.
278
+
279
+ **Purpose:**
280
+ Remove unwanted, duplicate, or incorrect files from staging tables before ingestion.
281
+ The file is deleted from both S3 and database tracking, and table statistics
282
+ are automatically recalculated.
283
+
284
+ **Use Cases:**
285
+ - Remove duplicate uploads
286
+ - Delete files with incorrect data
287
+ - Clean up failed uploads
288
+ - Fix data quality issues before ingestion
289
+ - Manage storage usage
290
+
291
+ **What Happens:**
292
+ 1. File deleted from S3 storage
293
+ 2. Database tracking record removed
294
+ 3. Table statistics recalculated (file count, size, row count)
295
+ 4. DuckDB automatically excludes file from future queries
296
+
297
+ **Security:**
298
+ - Write access required (verified via auth)
299
+ - Shared repositories block file deletions
300
+ - Full audit trail of deletion operations
301
+ - Cannot delete after ingestion to graph
302
+
303
+ **Example Response:**
304
+ ```json
305
+ {
306
+ \"status\": \"deleted\",
307
+ \"file_id\": \"f123\",
308
+ \"file_name\": \"entities_batch1.parquet\",
309
+ \"message\": \"File deleted successfully. DuckDB will automatically exclude it from queries.\"
310
+ }
311
+ ```
312
+
313
+ **Example Usage:**
314
+ ```bash
315
+ curl -X DELETE -H \"Authorization: Bearer YOUR_TOKEN\" \
316
+ https://api.robosystems.ai/v1/graphs/kg123/tables/files/f123
317
+ ```
318
+
319
+ **Tips:**
320
+ - Delete files before ingestion for best results
321
+ - Table statistics update automatically
322
+ - No need to refresh DuckDB - exclusion is automatic
323
+ - Consider re-uploading corrected version after deletion
324
+
325
+ **Note:**
326
+ File deletion is included - no credit consumption.
327
+
328
+ Args:
329
+ graph_id (str): Graph database identifier
330
+ file_id (str): File ID
331
+ token (Union[None, Unset, str]): JWT token for SSE authentication
332
+ authorization (Union[None, Unset, str]):
333
+
334
+ Raises:
335
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
336
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
337
+
338
+ Returns:
339
+ Response[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]
340
+ """
341
+
342
+ kwargs = _get_kwargs(
343
+ graph_id=graph_id,
344
+ file_id=file_id,
345
+ token=token,
346
+ authorization=authorization,
347
+ )
348
+
349
+ response = await client.get_async_httpx_client().request(**kwargs)
350
+
351
+ return _build_response(client=client, response=response)
352
+
353
+
354
+ async def asyncio(
355
+ graph_id: str,
356
+ file_id: str,
357
+ *,
358
+ client: AuthenticatedClient,
359
+ token: Union[None, Unset, str] = UNSET,
360
+ authorization: Union[None, Unset, str] = UNSET,
361
+ ) -> Optional[Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]]:
362
+ r""" Delete File from Staging
363
+
364
+ Delete a file from S3 storage and database tracking.
365
+
366
+ **Purpose:**
367
+ Remove unwanted, duplicate, or incorrect files from staging tables before ingestion.
368
+ The file is deleted from both S3 and database tracking, and table statistics
369
+ are automatically recalculated.
370
+
371
+ **Use Cases:**
372
+ - Remove duplicate uploads
373
+ - Delete files with incorrect data
374
+ - Clean up failed uploads
375
+ - Fix data quality issues before ingestion
376
+ - Manage storage usage
377
+
378
+ **What Happens:**
379
+ 1. File deleted from S3 storage
380
+ 2. Database tracking record removed
381
+ 3. Table statistics recalculated (file count, size, row count)
382
+ 4. DuckDB automatically excludes file from future queries
383
+
384
+ **Security:**
385
+ - Write access required (verified via auth)
386
+ - Shared repositories block file deletions
387
+ - Full audit trail of deletion operations
388
+ - Cannot delete after ingestion to graph
389
+
390
+ **Example Response:**
391
+ ```json
392
+ {
393
+ \"status\": \"deleted\",
394
+ \"file_id\": \"f123\",
395
+ \"file_name\": \"entities_batch1.parquet\",
396
+ \"message\": \"File deleted successfully. DuckDB will automatically exclude it from queries.\"
397
+ }
398
+ ```
399
+
400
+ **Example Usage:**
401
+ ```bash
402
+ curl -X DELETE -H \"Authorization: Bearer YOUR_TOKEN\" \
403
+ https://api.robosystems.ai/v1/graphs/kg123/tables/files/f123
404
+ ```
405
+
406
+ **Tips:**
407
+ - Delete files before ingestion for best results
408
+ - Table statistics update automatically
409
+ - No need to refresh DuckDB - exclusion is automatic
410
+ - Consider re-uploading corrected version after deletion
411
+
412
+ **Note:**
413
+ File deletion is included - no credit consumption.
414
+
415
+ Args:
416
+ graph_id (str): Graph database identifier
417
+ file_id (str): File ID
418
+ token (Union[None, Unset, str]): JWT token for SSE authentication
419
+ authorization (Union[None, Unset, str]):
420
+
421
+ Raises:
422
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
423
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
424
+
425
+ Returns:
426
+ Union[Any, DeleteFileResponse, ErrorResponse, HTTPValidationError]
427
+ """
428
+
429
+ return (
430
+ await asyncio_detailed(
431
+ graph_id=graph_id,
432
+ file_id=file_id,
433
+ client=client,
434
+ token=token,
435
+ authorization=authorization,
436
+ )
437
+ ).parsed