arthur-client 1.4.1283__py3-none-any.whl → 1.4.1285__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.
- arthur_client/api_bindings/__init__.py +2 -1
- arthur_client/api_bindings/api/custom_aggregations_v1_api.py +8 -42
- arthur_client/api_bindings/docs/CustomAggregationSpecSchema.md +3 -7
- arthur_client/api_bindings/docs/CustomAggregationVersionSpecSchema.md +35 -0
- arthur_client/api_bindings/docs/{CustomAggregationSpecSchemaAggregateArgsInner.md → CustomAggregationVersionSpecSchemaAggregateArgsInner.md} +8 -8
- arthur_client/api_bindings/docs/CustomAggregationsV1Api.md +5 -9
- arthur_client/api_bindings/docs/PostCustomAggregationSpecSchema.md +3 -3
- arthur_client/api_bindings/docs/PutCustomAggregationSpecSchema.md +1 -3
- arthur_client/api_bindings/models/__init__.py +2 -1
- arthur_client/api_bindings/models/custom_aggregation_spec_schema.py +14 -41
- arthur_client/api_bindings/models/custom_aggregation_version_spec_schema.py +126 -0
- arthur_client/api_bindings/models/{custom_aggregation_spec_schema_aggregate_args_inner.py → custom_aggregation_version_spec_schema_aggregate_args_inner.py} +6 -6
- arthur_client/api_bindings/models/post_custom_aggregation_spec_schema.py +9 -9
- arthur_client/api_bindings/models/put_custom_aggregation_spec_schema.py +5 -14
- arthur_client/api_bindings/test/test_custom_aggregation_spec_schema.py +72 -62
- arthur_client/api_bindings/test/test_custom_aggregation_version_spec_schema.py +112 -0
- arthur_client/api_bindings/test/{test_custom_aggregation_spec_schema_aggregate_args_inner.py → test_custom_aggregation_version_spec_schema_aggregate_args_inner.py} +11 -11
- arthur_client/api_bindings/test/test_post_custom_aggregation_spec_schema.py +4 -4
- arthur_client/api_bindings/test/test_put_custom_aggregation_spec_schema.py +0 -3
- arthur_client/api_bindings/test/test_resource_list_custom_aggregation_spec_schema.py +72 -62
- arthur_client/api_bindings_README.md +2 -1
- {arthur_client-1.4.1283.dist-info → arthur_client-1.4.1285.dist-info}/METADATA +1 -1
- {arthur_client-1.4.1283.dist-info → arthur_client-1.4.1285.dist-info}/RECORD +24 -21
- {arthur_client-1.4.1283.dist-info → arthur_client-1.4.1285.dist-info}/WHEEL +0 -0
@@ -105,7 +105,8 @@ from arthur_client.api_bindings.models.create_model_task_job_spec import CreateM
|
|
105
105
|
from arthur_client.api_bindings.models.created_alerts import CreatedAlerts
|
106
106
|
from arthur_client.api_bindings.models.credentials import Credentials
|
107
107
|
from arthur_client.api_bindings.models.custom_aggregation_spec_schema import CustomAggregationSpecSchema
|
108
|
-
from arthur_client.api_bindings.models.
|
108
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema import CustomAggregationVersionSpecSchema
|
109
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema_aggregate_args_inner import CustomAggregationVersionSpecSchemaAggregateArgsInner
|
109
110
|
from arthur_client.api_bindings.models.d_type import DType
|
110
111
|
from arthur_client.api_bindings.models.data_plane import DataPlane
|
111
112
|
from arthur_client.api_bindings.models.data_plane_association import DataPlaneAssociation
|
@@ -319,8 +319,6 @@ class CustomAggregationsV1Api:
|
|
319
319
|
custom_aggregation_id: StrictStr,
|
320
320
|
version: Annotated[Optional[StrictInt], Field(description="The version of the custom aggregation to fetch.")] = None,
|
321
321
|
latest: Annotated[Optional[StrictBool], Field(description="Whether to fetch the latest version of the custom aggregation.")] = None,
|
322
|
-
page: Annotated[Optional[StrictInt], Field(description="The page number to fetch.")] = None,
|
323
|
-
page_size: Annotated[Optional[StrictInt], Field(description="The number of items per page.")] = None,
|
324
322
|
_request_timeout: Union[
|
325
323
|
None,
|
326
324
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -333,10 +331,10 @@ class CustomAggregationsV1Api:
|
|
333
331
|
_content_type: Optional[StrictStr] = None,
|
334
332
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
335
333
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
336
|
-
) ->
|
334
|
+
) -> CustomAggregationSpecSchema:
|
337
335
|
"""Get Custom Aggregation By Id.
|
338
336
|
|
339
|
-
Requires custom_aggregation_read permission.
|
337
|
+
Requires custom_aggregation_read permission. Includes version filters to specify the versions included on the returned aggregation.
|
340
338
|
|
341
339
|
:param custom_aggregation_id: (required)
|
342
340
|
:type custom_aggregation_id: str
|
@@ -344,10 +342,6 @@ class CustomAggregationsV1Api:
|
|
344
342
|
:type version: int
|
345
343
|
:param latest: Whether to fetch the latest version of the custom aggregation.
|
346
344
|
:type latest: bool
|
347
|
-
:param page: The page number to fetch.
|
348
|
-
:type page: int
|
349
|
-
:param page_size: The number of items per page.
|
350
|
-
:type page_size: int
|
351
345
|
:param _request_timeout: timeout setting for this request. If one
|
352
346
|
number provided, it will be total request
|
353
347
|
timeout. It can also be a pair (tuple) of
|
@@ -374,8 +368,6 @@ class CustomAggregationsV1Api:
|
|
374
368
|
custom_aggregation_id=custom_aggregation_id,
|
375
369
|
version=version,
|
376
370
|
latest=latest,
|
377
|
-
page=page,
|
378
|
-
page_size=page_size,
|
379
371
|
_request_auth=_request_auth,
|
380
372
|
_content_type=_content_type,
|
381
373
|
_headers=_headers,
|
@@ -383,7 +375,7 @@ class CustomAggregationsV1Api:
|
|
383
375
|
)
|
384
376
|
|
385
377
|
_response_types_map: Dict[str, Optional[str]] = {
|
386
|
-
'200': "
|
378
|
+
'200': "CustomAggregationSpecSchema",
|
387
379
|
'500': "InternalServerError",
|
388
380
|
'404': "NotFoundError",
|
389
381
|
'422': "HTTPValidationError",
|
@@ -405,8 +397,6 @@ class CustomAggregationsV1Api:
|
|
405
397
|
custom_aggregation_id: StrictStr,
|
406
398
|
version: Annotated[Optional[StrictInt], Field(description="The version of the custom aggregation to fetch.")] = None,
|
407
399
|
latest: Annotated[Optional[StrictBool], Field(description="Whether to fetch the latest version of the custom aggregation.")] = None,
|
408
|
-
page: Annotated[Optional[StrictInt], Field(description="The page number to fetch.")] = None,
|
409
|
-
page_size: Annotated[Optional[StrictInt], Field(description="The number of items per page.")] = None,
|
410
400
|
_request_timeout: Union[
|
411
401
|
None,
|
412
402
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -419,10 +409,10 @@ class CustomAggregationsV1Api:
|
|
419
409
|
_content_type: Optional[StrictStr] = None,
|
420
410
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
421
411
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
422
|
-
) -> ApiResponse[
|
412
|
+
) -> ApiResponse[CustomAggregationSpecSchema]:
|
423
413
|
"""Get Custom Aggregation By Id.
|
424
414
|
|
425
|
-
Requires custom_aggregation_read permission.
|
415
|
+
Requires custom_aggregation_read permission. Includes version filters to specify the versions included on the returned aggregation.
|
426
416
|
|
427
417
|
:param custom_aggregation_id: (required)
|
428
418
|
:type custom_aggregation_id: str
|
@@ -430,10 +420,6 @@ class CustomAggregationsV1Api:
|
|
430
420
|
:type version: int
|
431
421
|
:param latest: Whether to fetch the latest version of the custom aggregation.
|
432
422
|
:type latest: bool
|
433
|
-
:param page: The page number to fetch.
|
434
|
-
:type page: int
|
435
|
-
:param page_size: The number of items per page.
|
436
|
-
:type page_size: int
|
437
423
|
:param _request_timeout: timeout setting for this request. If one
|
438
424
|
number provided, it will be total request
|
439
425
|
timeout. It can also be a pair (tuple) of
|
@@ -460,8 +446,6 @@ class CustomAggregationsV1Api:
|
|
460
446
|
custom_aggregation_id=custom_aggregation_id,
|
461
447
|
version=version,
|
462
448
|
latest=latest,
|
463
|
-
page=page,
|
464
|
-
page_size=page_size,
|
465
449
|
_request_auth=_request_auth,
|
466
450
|
_content_type=_content_type,
|
467
451
|
_headers=_headers,
|
@@ -469,7 +453,7 @@ class CustomAggregationsV1Api:
|
|
469
453
|
)
|
470
454
|
|
471
455
|
_response_types_map: Dict[str, Optional[str]] = {
|
472
|
-
'200': "
|
456
|
+
'200': "CustomAggregationSpecSchema",
|
473
457
|
'500': "InternalServerError",
|
474
458
|
'404': "NotFoundError",
|
475
459
|
'422': "HTTPValidationError",
|
@@ -491,8 +475,6 @@ class CustomAggregationsV1Api:
|
|
491
475
|
custom_aggregation_id: StrictStr,
|
492
476
|
version: Annotated[Optional[StrictInt], Field(description="The version of the custom aggregation to fetch.")] = None,
|
493
477
|
latest: Annotated[Optional[StrictBool], Field(description="Whether to fetch the latest version of the custom aggregation.")] = None,
|
494
|
-
page: Annotated[Optional[StrictInt], Field(description="The page number to fetch.")] = None,
|
495
|
-
page_size: Annotated[Optional[StrictInt], Field(description="The number of items per page.")] = None,
|
496
478
|
_request_timeout: Union[
|
497
479
|
None,
|
498
480
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -508,7 +490,7 @@ class CustomAggregationsV1Api:
|
|
508
490
|
) -> RESTResponseType:
|
509
491
|
"""Get Custom Aggregation By Id.
|
510
492
|
|
511
|
-
Requires custom_aggregation_read permission.
|
493
|
+
Requires custom_aggregation_read permission. Includes version filters to specify the versions included on the returned aggregation.
|
512
494
|
|
513
495
|
:param custom_aggregation_id: (required)
|
514
496
|
:type custom_aggregation_id: str
|
@@ -516,10 +498,6 @@ class CustomAggregationsV1Api:
|
|
516
498
|
:type version: int
|
517
499
|
:param latest: Whether to fetch the latest version of the custom aggregation.
|
518
500
|
:type latest: bool
|
519
|
-
:param page: The page number to fetch.
|
520
|
-
:type page: int
|
521
|
-
:param page_size: The number of items per page.
|
522
|
-
:type page_size: int
|
523
501
|
:param _request_timeout: timeout setting for this request. If one
|
524
502
|
number provided, it will be total request
|
525
503
|
timeout. It can also be a pair (tuple) of
|
@@ -546,8 +524,6 @@ class CustomAggregationsV1Api:
|
|
546
524
|
custom_aggregation_id=custom_aggregation_id,
|
547
525
|
version=version,
|
548
526
|
latest=latest,
|
549
|
-
page=page,
|
550
|
-
page_size=page_size,
|
551
527
|
_request_auth=_request_auth,
|
552
528
|
_content_type=_content_type,
|
553
529
|
_headers=_headers,
|
@@ -555,7 +531,7 @@ class CustomAggregationsV1Api:
|
|
555
531
|
)
|
556
532
|
|
557
533
|
_response_types_map: Dict[str, Optional[str]] = {
|
558
|
-
'200': "
|
534
|
+
'200': "CustomAggregationSpecSchema",
|
559
535
|
'500': "InternalServerError",
|
560
536
|
'404': "NotFoundError",
|
561
537
|
'422': "HTTPValidationError",
|
@@ -572,8 +548,6 @@ class CustomAggregationsV1Api:
|
|
572
548
|
custom_aggregation_id,
|
573
549
|
version,
|
574
550
|
latest,
|
575
|
-
page,
|
576
|
-
page_size,
|
577
551
|
_request_auth,
|
578
552
|
_content_type,
|
579
553
|
_headers,
|
@@ -606,14 +580,6 @@ class CustomAggregationsV1Api:
|
|
606
580
|
|
607
581
|
_query_params.append(('latest', latest))
|
608
582
|
|
609
|
-
if page is not None:
|
610
|
-
|
611
|
-
_query_params.append(('page', page))
|
612
|
-
|
613
|
-
if page_size is not None:
|
614
|
-
|
615
|
-
_query_params.append(('page_size', page_size))
|
616
|
-
|
617
583
|
# process the header parameters
|
618
584
|
# process the form parameters
|
619
585
|
# process the body parameter
|
@@ -5,16 +5,12 @@
|
|
5
5
|
|
6
6
|
Name | Type | Description | Notes
|
7
7
|
------------ | ------------- | ------------- | -------------
|
8
|
+
**id** | **str** | Unique identifier of the custom aggregation with version. |
|
8
9
|
**name** | **str** | Name of the custom aggregation function. |
|
9
10
|
**description** | **str** | | [optional]
|
10
|
-
**reported_aggregations** | [**List[ReportedCustomAggregation]**](ReportedCustomAggregation.md) | Metadata for every aggregation the custom aggregation reports. |
|
11
|
-
**aggregate_args** | [**List[CustomAggregationSpecSchemaAggregateArgsInner]**](CustomAggregationSpecSchemaAggregateArgsInner.md) | List of parameters to the custom aggregation's query function. |
|
12
|
-
**sql** | **str** | DuckDBSQL query for the custom aggregation. |
|
13
|
-
**id** | **str** | Unique identifier of the custom aggregation with version. |
|
14
11
|
**workspace_id** | **str** | Unique identifier of the custom aggregation's parent workspace. |
|
15
|
-
**
|
16
|
-
**
|
17
|
-
**created_at** | **datetime** | Time of aggregation creation. |
|
12
|
+
**versions** | [**List[CustomAggregationVersionSpecSchema]**](CustomAggregationVersionSpecSchema.md) | List of versions of the custom aggregation configuration. |
|
13
|
+
**latest_version** | **int** | Max/latest version of the custom aggregation that exists. This version may or may not be included in the list of versions depending on applied filters. |
|
18
14
|
|
19
15
|
## Example
|
20
16
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# CustomAggregationVersionSpecSchema
|
2
|
+
|
3
|
+
|
4
|
+
## Properties
|
5
|
+
|
6
|
+
Name | Type | Description | Notes
|
7
|
+
------------ | ------------- | ------------- | -------------
|
8
|
+
**custom_aggregation_id** | **str** | ID of parent custom aggregation. |
|
9
|
+
**version** | **int** | Version number of the custom aggregation function. |
|
10
|
+
**authored_by** | [**User**](User.md) | |
|
11
|
+
**created_at** | **datetime** | Time of aggregation creation. |
|
12
|
+
**reported_aggregations** | [**List[ReportedCustomAggregation]**](ReportedCustomAggregation.md) | Metadata for every aggregation the custom aggregation reports. |
|
13
|
+
**aggregate_args** | [**List[CustomAggregationVersionSpecSchemaAggregateArgsInner]**](CustomAggregationVersionSpecSchemaAggregateArgsInner.md) | List of parameters to the custom aggregation's query function. |
|
14
|
+
**sql** | **str** | DuckDBSQL query for the custom aggregation. |
|
15
|
+
|
16
|
+
## Example
|
17
|
+
|
18
|
+
```python
|
19
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema import CustomAggregationVersionSpecSchema
|
20
|
+
|
21
|
+
# TODO update the JSON string below
|
22
|
+
json = "{}"
|
23
|
+
# create an instance of CustomAggregationVersionSpecSchema from a JSON string
|
24
|
+
custom_aggregation_version_spec_schema_instance = CustomAggregationVersionSpecSchema.from_json(json)
|
25
|
+
# print the JSON string representation of the object
|
26
|
+
print(CustomAggregationVersionSpecSchema.to_json())
|
27
|
+
|
28
|
+
# convert the object into a dict
|
29
|
+
custom_aggregation_version_spec_schema_dict = custom_aggregation_version_spec_schema_instance.to_dict()
|
30
|
+
# create an instance of CustomAggregationVersionSpecSchema from a dict
|
31
|
+
custom_aggregation_version_spec_schema_from_dict = CustomAggregationVersionSpecSchema.from_dict(custom_aggregation_version_spec_schema_dict)
|
32
|
+
```
|
33
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
34
|
+
|
35
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# CustomAggregationVersionSpecSchemaAggregateArgsInner
|
2
2
|
|
3
3
|
|
4
4
|
## Properties
|
@@ -19,19 +19,19 @@ Name | Type | Description | Notes
|
|
19
19
|
## Example
|
20
20
|
|
21
21
|
```python
|
22
|
-
from arthur_client.api_bindings.models.
|
22
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema_aggregate_args_inner import CustomAggregationVersionSpecSchemaAggregateArgsInner
|
23
23
|
|
24
24
|
# TODO update the JSON string below
|
25
25
|
json = "{}"
|
26
|
-
# create an instance of
|
27
|
-
|
26
|
+
# create an instance of CustomAggregationVersionSpecSchemaAggregateArgsInner from a JSON string
|
27
|
+
custom_aggregation_version_spec_schema_aggregate_args_inner_instance = CustomAggregationVersionSpecSchemaAggregateArgsInner.from_json(json)
|
28
28
|
# print the JSON string representation of the object
|
29
|
-
print(
|
29
|
+
print(CustomAggregationVersionSpecSchemaAggregateArgsInner.to_json())
|
30
30
|
|
31
31
|
# convert the object into a dict
|
32
|
-
|
33
|
-
# create an instance of
|
34
|
-
|
32
|
+
custom_aggregation_version_spec_schema_aggregate_args_inner_dict = custom_aggregation_version_spec_schema_aggregate_args_inner_instance.to_dict()
|
33
|
+
# create an instance of CustomAggregationVersionSpecSchemaAggregateArgsInner from a dict
|
34
|
+
custom_aggregation_version_spec_schema_aggregate_args_inner_from_dict = CustomAggregationVersionSpecSchemaAggregateArgsInner.from_dict(custom_aggregation_version_spec_schema_aggregate_args_inner_dict)
|
35
35
|
```
|
36
36
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
37
37
|
|
@@ -88,11 +88,11 @@ void (empty response body)
|
|
88
88
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
89
89
|
|
90
90
|
# **get_custom_aggregation**
|
91
|
-
>
|
91
|
+
> CustomAggregationSpecSchema get_custom_aggregation(custom_aggregation_id, version=version, latest=latest)
|
92
92
|
|
93
93
|
Get Custom Aggregation By Id.
|
94
94
|
|
95
|
-
Requires custom_aggregation_read permission.
|
95
|
+
Requires custom_aggregation_read permission. Includes version filters to specify the versions included on the returned aggregation.
|
96
96
|
|
97
97
|
### Example
|
98
98
|
|
@@ -100,7 +100,7 @@ Requires custom_aggregation_read permission.
|
|
100
100
|
|
101
101
|
```python
|
102
102
|
import arthur_client.api_bindings
|
103
|
-
from arthur_client.api_bindings.models.
|
103
|
+
from arthur_client.api_bindings.models.custom_aggregation_spec_schema import CustomAggregationSpecSchema
|
104
104
|
from arthur_client.api_bindings.rest import ApiException
|
105
105
|
from pprint import pprint
|
106
106
|
|
@@ -124,12 +124,10 @@ with arthur_client.api_bindings.ApiClient(configuration) as api_client:
|
|
124
124
|
custom_aggregation_id = 'custom_aggregation_id_example' # str |
|
125
125
|
version = 56 # int | The version of the custom aggregation to fetch. (optional)
|
126
126
|
latest = False # bool | Whether to fetch the latest version of the custom aggregation. (optional) (default to False)
|
127
|
-
page = 1 # int | The page number to fetch. (optional) (default to 1)
|
128
|
-
page_size = 10 # int | The number of items per page. (optional) (default to 10)
|
129
127
|
|
130
128
|
try:
|
131
129
|
# Get Custom Aggregation By Id.
|
132
|
-
api_response = api_instance.get_custom_aggregation(custom_aggregation_id, version=version, latest=latest
|
130
|
+
api_response = api_instance.get_custom_aggregation(custom_aggregation_id, version=version, latest=latest)
|
133
131
|
print("The response of CustomAggregationsV1Api->get_custom_aggregation:\n")
|
134
132
|
pprint(api_response)
|
135
133
|
except Exception as e:
|
@@ -146,12 +144,10 @@ Name | Type | Description | Notes
|
|
146
144
|
**custom_aggregation_id** | **str**| |
|
147
145
|
**version** | **int**| The version of the custom aggregation to fetch. | [optional]
|
148
146
|
**latest** | **bool**| Whether to fetch the latest version of the custom aggregation. | [optional] [default to False]
|
149
|
-
**page** | **int**| The page number to fetch. | [optional] [default to 1]
|
150
|
-
**page_size** | **int**| The number of items per page. | [optional] [default to 10]
|
151
147
|
|
152
148
|
### Return type
|
153
149
|
|
154
|
-
[**
|
150
|
+
[**CustomAggregationSpecSchema**](CustomAggregationSpecSchema.md)
|
155
151
|
|
156
152
|
### Authorization
|
157
153
|
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Name | Type | Description | Notes
|
7
7
|
------------ | ------------- | ------------- | -------------
|
8
|
-
**name** | **str** | Name of the custom aggregation function. |
|
9
|
-
**description** | **str** | | [optional]
|
10
8
|
**reported_aggregations** | [**List[ReportedCustomAggregation]**](ReportedCustomAggregation.md) | Metadata for every aggregation the custom aggregation reports. |
|
11
|
-
**aggregate_args** | [**List[
|
9
|
+
**aggregate_args** | [**List[CustomAggregationVersionSpecSchemaAggregateArgsInner]**](CustomAggregationVersionSpecSchemaAggregateArgsInner.md) | List of parameters to the custom aggregation's query function. |
|
12
10
|
**sql** | **str** | DuckDBSQL query for the custom aggregation. |
|
11
|
+
**name** | **str** | Name of the custom aggregation function. |
|
12
|
+
**description** | **str** | | [optional]
|
13
13
|
|
14
14
|
## Example
|
15
15
|
|
@@ -5,10 +5,8 @@
|
|
5
5
|
|
6
6
|
Name | Type | Description | Notes
|
7
7
|
------------ | ------------- | ------------- | -------------
|
8
|
-
**name** | **str** | Name of the custom aggregation function. |
|
9
|
-
**description** | **str** | | [optional]
|
10
8
|
**reported_aggregations** | [**List[ReportedCustomAggregation]**](ReportedCustomAggregation.md) | Metadata for every aggregation the custom aggregation reports. |
|
11
|
-
**aggregate_args** | [**List[
|
9
|
+
**aggregate_args** | [**List[CustomAggregationVersionSpecSchemaAggregateArgsInner]**](CustomAggregationVersionSpecSchemaAggregateArgsInner.md) | List of parameters to the custom aggregation's query function. |
|
12
10
|
**sql** | **str** | DuckDBSQL query for the custom aggregation. |
|
13
11
|
|
14
12
|
## Example
|
@@ -62,7 +62,8 @@ from arthur_client.api_bindings.models.create_model_task_job_spec import CreateM
|
|
62
62
|
from arthur_client.api_bindings.models.created_alerts import CreatedAlerts
|
63
63
|
from arthur_client.api_bindings.models.credentials import Credentials
|
64
64
|
from arthur_client.api_bindings.models.custom_aggregation_spec_schema import CustomAggregationSpecSchema
|
65
|
-
from arthur_client.api_bindings.models.
|
65
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema import CustomAggregationVersionSpecSchema
|
66
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema_aggregate_args_inner import CustomAggregationVersionSpecSchemaAggregateArgsInner
|
66
67
|
from arthur_client.api_bindings.models.d_type import DType
|
67
68
|
from arthur_client.api_bindings.models.data_plane import DataPlane
|
68
69
|
from arthur_client.api_bindings.models.data_plane_association import DataPlaneAssociation
|
@@ -17,13 +17,9 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from datetime import datetime
|
21
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
22
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
-
from
|
24
|
-
from arthur_client.api_bindings.models.custom_aggregation_spec_schema_aggregate_args_inner import CustomAggregationSpecSchemaAggregateArgsInner
|
25
|
-
from arthur_client.api_bindings.models.reported_custom_aggregation import ReportedCustomAggregation
|
26
|
-
from arthur_client.api_bindings.models.user import User
|
22
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema import CustomAggregationVersionSpecSchema
|
27
23
|
from typing import Optional, Set
|
28
24
|
from typing_extensions import Self
|
29
25
|
|
@@ -31,17 +27,13 @@ class CustomAggregationSpecSchema(BaseModel):
|
|
31
27
|
"""
|
32
28
|
CustomAggregationSpecSchema
|
33
29
|
""" # noqa: E501
|
30
|
+
id: StrictStr = Field(description="Unique identifier of the custom aggregation with version.")
|
34
31
|
name: StrictStr = Field(description="Name of the custom aggregation function.")
|
35
32
|
description: Optional[StrictStr] = None
|
36
|
-
reported_aggregations: Annotated[List[ReportedCustomAggregation], Field(min_length=1)] = Field(description="Metadata for every aggregation the custom aggregation reports.")
|
37
|
-
aggregate_args: List[CustomAggregationSpecSchemaAggregateArgsInner] = Field(description="List of parameters to the custom aggregation's query function.")
|
38
|
-
sql: StrictStr = Field(description="DuckDBSQL query for the custom aggregation.")
|
39
|
-
id: StrictStr = Field(description="Unique identifier of the custom aggregation with version.")
|
40
33
|
workspace_id: StrictStr = Field(description="Unique identifier of the custom aggregation's parent workspace.")
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
__properties: ClassVar[List[str]] = ["name", "description", "reported_aggregations", "aggregate_args", "sql", "id", "workspace_id", "version", "authored_by", "created_at"]
|
34
|
+
versions: List[CustomAggregationVersionSpecSchema] = Field(description="List of versions of the custom aggregation configuration.")
|
35
|
+
latest_version: StrictInt = Field(description="Max/latest version of the custom aggregation that exists. This version may or may not be included in the list of versions depending on applied filters.")
|
36
|
+
__properties: ClassVar[List[str]] = ["id", "name", "description", "workspace_id", "versions", "latest_version"]
|
45
37
|
|
46
38
|
model_config = ConfigDict(
|
47
39
|
populate_by_name=True,
|
@@ -82,33 +74,18 @@ class CustomAggregationSpecSchema(BaseModel):
|
|
82
74
|
exclude=excluded_fields,
|
83
75
|
exclude_none=True,
|
84
76
|
)
|
85
|
-
# override the default output from pydantic by calling `to_dict()` of each item in
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of each item in versions (list)
|
86
78
|
_items = []
|
87
|
-
if self.
|
88
|
-
for
|
89
|
-
if
|
90
|
-
_items.append(
|
91
|
-
_dict['
|
92
|
-
# override the default output from pydantic by calling `to_dict()` of each item in aggregate_args (list)
|
93
|
-
_items = []
|
94
|
-
if self.aggregate_args:
|
95
|
-
for _item_aggregate_args in self.aggregate_args:
|
96
|
-
if _item_aggregate_args:
|
97
|
-
_items.append(_item_aggregate_args.to_dict())
|
98
|
-
_dict['aggregate_args'] = _items
|
99
|
-
# override the default output from pydantic by calling `to_dict()` of authored_by
|
100
|
-
if self.authored_by:
|
101
|
-
_dict['authored_by'] = self.authored_by.to_dict()
|
79
|
+
if self.versions:
|
80
|
+
for _item_versions in self.versions:
|
81
|
+
if _item_versions:
|
82
|
+
_items.append(_item_versions.to_dict())
|
83
|
+
_dict['versions'] = _items
|
102
84
|
# set to None if description (nullable) is None
|
103
85
|
# and model_fields_set contains the field
|
104
86
|
if self.description is None and "description" in self.model_fields_set:
|
105
87
|
_dict['description'] = None
|
106
88
|
|
107
|
-
# set to None if authored_by (nullable) is None
|
108
|
-
# and model_fields_set contains the field
|
109
|
-
if self.authored_by is None and "authored_by" in self.model_fields_set:
|
110
|
-
_dict['authored_by'] = None
|
111
|
-
|
112
89
|
return _dict
|
113
90
|
|
114
91
|
@classmethod
|
@@ -121,16 +98,12 @@ class CustomAggregationSpecSchema(BaseModel):
|
|
121
98
|
return cls.model_validate(obj)
|
122
99
|
|
123
100
|
_obj = cls.model_validate({
|
101
|
+
"id": obj.get("id"),
|
124
102
|
"name": obj.get("name"),
|
125
103
|
"description": obj.get("description"),
|
126
|
-
"reported_aggregations": [ReportedCustomAggregation.from_dict(_item) for _item in obj["reported_aggregations"]] if obj.get("reported_aggregations") is not None else None,
|
127
|
-
"aggregate_args": [CustomAggregationSpecSchemaAggregateArgsInner.from_dict(_item) for _item in obj["aggregate_args"]] if obj.get("aggregate_args") is not None else None,
|
128
|
-
"sql": obj.get("sql"),
|
129
|
-
"id": obj.get("id"),
|
130
104
|
"workspace_id": obj.get("workspace_id"),
|
131
|
-
"
|
132
|
-
"
|
133
|
-
"created_at": obj.get("created_at")
|
105
|
+
"versions": [CustomAggregationVersionSpecSchema.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None,
|
106
|
+
"latest_version": obj.get("latest_version")
|
134
107
|
})
|
135
108
|
return _obj
|
136
109
|
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Arthur Scope
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from arthur_client.api_bindings.models.custom_aggregation_version_spec_schema_aggregate_args_inner import CustomAggregationVersionSpecSchemaAggregateArgsInner
|
25
|
+
from arthur_client.api_bindings.models.reported_custom_aggregation import ReportedCustomAggregation
|
26
|
+
from arthur_client.api_bindings.models.user import User
|
27
|
+
from typing import Optional, Set
|
28
|
+
from typing_extensions import Self
|
29
|
+
|
30
|
+
class CustomAggregationVersionSpecSchema(BaseModel):
|
31
|
+
"""
|
32
|
+
CustomAggregationVersionSpecSchema
|
33
|
+
""" # noqa: E501
|
34
|
+
custom_aggregation_id: StrictStr = Field(description="ID of parent custom aggregation.")
|
35
|
+
version: StrictInt = Field(description="Version number of the custom aggregation function.")
|
36
|
+
authored_by: Optional[User]
|
37
|
+
created_at: datetime = Field(description="Time of aggregation creation.")
|
38
|
+
reported_aggregations: Annotated[List[ReportedCustomAggregation], Field(min_length=1)] = Field(description="Metadata for every aggregation the custom aggregation reports.")
|
39
|
+
aggregate_args: List[CustomAggregationVersionSpecSchemaAggregateArgsInner] = Field(description="List of parameters to the custom aggregation's query function.")
|
40
|
+
sql: StrictStr = Field(description="DuckDBSQL query for the custom aggregation.")
|
41
|
+
__properties: ClassVar[List[str]] = ["custom_aggregation_id", "version", "authored_by", "created_at", "reported_aggregations", "aggregate_args", "sql"]
|
42
|
+
|
43
|
+
model_config = ConfigDict(
|
44
|
+
populate_by_name=True,
|
45
|
+
validate_assignment=True,
|
46
|
+
protected_namespaces=(),
|
47
|
+
)
|
48
|
+
|
49
|
+
|
50
|
+
def to_str(self) -> str:
|
51
|
+
"""Returns the string representation of the model using alias"""
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
53
|
+
|
54
|
+
def to_json(self) -> str:
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
57
|
+
return json.dumps(self.to_dict())
|
58
|
+
|
59
|
+
@classmethod
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
61
|
+
"""Create an instance of CustomAggregationVersionSpecSchema from a JSON string"""
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
63
|
+
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
66
|
+
|
67
|
+
This has the following differences from calling pydantic's
|
68
|
+
`self.model_dump(by_alias=True)`:
|
69
|
+
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
71
|
+
were set at model initialization. Other fields with value `None`
|
72
|
+
are ignored.
|
73
|
+
"""
|
74
|
+
excluded_fields: Set[str] = set([
|
75
|
+
])
|
76
|
+
|
77
|
+
_dict = self.model_dump(
|
78
|
+
by_alias=True,
|
79
|
+
exclude=excluded_fields,
|
80
|
+
exclude_none=True,
|
81
|
+
)
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of authored_by
|
83
|
+
if self.authored_by:
|
84
|
+
_dict['authored_by'] = self.authored_by.to_dict()
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of each item in reported_aggregations (list)
|
86
|
+
_items = []
|
87
|
+
if self.reported_aggregations:
|
88
|
+
for _item_reported_aggregations in self.reported_aggregations:
|
89
|
+
if _item_reported_aggregations:
|
90
|
+
_items.append(_item_reported_aggregations.to_dict())
|
91
|
+
_dict['reported_aggregations'] = _items
|
92
|
+
# override the default output from pydantic by calling `to_dict()` of each item in aggregate_args (list)
|
93
|
+
_items = []
|
94
|
+
if self.aggregate_args:
|
95
|
+
for _item_aggregate_args in self.aggregate_args:
|
96
|
+
if _item_aggregate_args:
|
97
|
+
_items.append(_item_aggregate_args.to_dict())
|
98
|
+
_dict['aggregate_args'] = _items
|
99
|
+
# set to None if authored_by (nullable) is None
|
100
|
+
# and model_fields_set contains the field
|
101
|
+
if self.authored_by is None and "authored_by" in self.model_fields_set:
|
102
|
+
_dict['authored_by'] = None
|
103
|
+
|
104
|
+
return _dict
|
105
|
+
|
106
|
+
@classmethod
|
107
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
108
|
+
"""Create an instance of CustomAggregationVersionSpecSchema from a dict"""
|
109
|
+
if obj is None:
|
110
|
+
return None
|
111
|
+
|
112
|
+
if not isinstance(obj, dict):
|
113
|
+
return cls.model_validate(obj)
|
114
|
+
|
115
|
+
_obj = cls.model_validate({
|
116
|
+
"custom_aggregation_id": obj.get("custom_aggregation_id"),
|
117
|
+
"version": obj.get("version"),
|
118
|
+
"authored_by": User.from_dict(obj["authored_by"]) if obj.get("authored_by") is not None else None,
|
119
|
+
"created_at": obj.get("created_at"),
|
120
|
+
"reported_aggregations": [ReportedCustomAggregation.from_dict(_item) for _item in obj["reported_aggregations"]] if obj.get("reported_aggregations") is not None else None,
|
121
|
+
"aggregate_args": [CustomAggregationVersionSpecSchemaAggregateArgsInner.from_dict(_item) for _item in obj["aggregate_args"]] if obj.get("aggregate_args") is not None else None,
|
122
|
+
"sql": obj.get("sql")
|
123
|
+
})
|
124
|
+
return _obj
|
125
|
+
|
126
|
+
|
@@ -26,11 +26,11 @@ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
26
26
|
from typing_extensions import Literal, Self
|
27
27
|
from pydantic import Field
|
28
28
|
|
29
|
-
|
29
|
+
CUSTOMAGGREGATIONVERSIONSPECSCHEMAAGGREGATEARGSINNER_ANY_OF_SCHEMAS = ["BaseColumnParameterSchema", "BaseDatasetParameterSchema", "BaseLiteralParameterSchema"]
|
30
30
|
|
31
|
-
class
|
31
|
+
class CustomAggregationVersionSpecSchemaAggregateArgsInner(BaseModel):
|
32
32
|
"""
|
33
|
-
|
33
|
+
CustomAggregationVersionSpecSchemaAggregateArgsInner
|
34
34
|
"""
|
35
35
|
|
36
36
|
# data type: BaseDatasetParameterSchema
|
@@ -62,7 +62,7 @@ class CustomAggregationSpecSchemaAggregateArgsInner(BaseModel):
|
|
62
62
|
|
63
63
|
@field_validator('actual_instance')
|
64
64
|
def actual_instance_must_validate_anyof(cls, v):
|
65
|
-
instance =
|
65
|
+
instance = CustomAggregationVersionSpecSchemaAggregateArgsInner.model_construct()
|
66
66
|
error_messages = []
|
67
67
|
# validate data type: BaseDatasetParameterSchema
|
68
68
|
if not isinstance(v, BaseDatasetParameterSchema):
|
@@ -84,7 +84,7 @@ class CustomAggregationSpecSchemaAggregateArgsInner(BaseModel):
|
|
84
84
|
|
85
85
|
if error_messages:
|
86
86
|
# no match
|
87
|
-
raise ValueError("No match found when setting the actual_instance in
|
87
|
+
raise ValueError("No match found when setting the actual_instance in CustomAggregationVersionSpecSchemaAggregateArgsInner with anyOf schemas: BaseColumnParameterSchema, BaseDatasetParameterSchema, BaseLiteralParameterSchema. Details: " + ", ".join(error_messages))
|
88
88
|
else:
|
89
89
|
return v
|
90
90
|
|
@@ -118,7 +118,7 @@ class CustomAggregationSpecSchemaAggregateArgsInner(BaseModel):
|
|
118
118
|
|
119
119
|
if error_messages:
|
120
120
|
# no match
|
121
|
-
raise ValueError("No match found when deserializing the JSON string into
|
121
|
+
raise ValueError("No match found when deserializing the JSON string into CustomAggregationVersionSpecSchemaAggregateArgsInner with anyOf schemas: BaseColumnParameterSchema, BaseDatasetParameterSchema, BaseLiteralParameterSchema. Details: " + ", ".join(error_messages))
|
122
122
|
else:
|
123
123
|
return instance
|
124
124
|
|