arthur-client 1.4.1233__py3-none-any.whl → 1.4.1235__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 +13 -1
- arthur_client/api_bindings/api/__init__.py +1 -0
- arthur_client/api_bindings/api/custom_aggregations_v1_api.py +1477 -0
- arthur_client/api_bindings/docs/AggregationSpecSchemaInitArgsInner.md +2 -2
- arthur_client/api_bindings/docs/BaseColumnParameterSchema.md +36 -0
- arthur_client/api_bindings/docs/BaseColumnParameterSchemaAllowedColumnTypesInner.md +31 -0
- arthur_client/api_bindings/docs/BaseDatasetParameterSchema.md +33 -0
- arthur_client/api_bindings/docs/BaseLiteralParameterSchema.md +33 -0
- arthur_client/api_bindings/docs/CustomAggregationSpecSchema.md +38 -0
- arthur_client/api_bindings/docs/CustomAggregationSpecSchemaAggregateArgsInner.md +38 -0
- arthur_client/api_bindings/docs/CustomAggregationsV1Api.md +410 -0
- arthur_client/api_bindings/docs/Items1.md +1 -1
- arthur_client/api_bindings/docs/MetricsColumnListParameterSchema.md +2 -2
- arthur_client/api_bindings/docs/MetricsColumnParameterSchema.md +2 -2
- arthur_client/api_bindings/docs/MetricsDatasetParameterSchema.md +1 -1
- arthur_client/api_bindings/docs/MetricsLiteralParameterSchema.md +1 -1
- arthur_client/api_bindings/docs/ObjectType.md +1 -1
- arthur_client/api_bindings/docs/PermissionName.md +10 -0
- arthur_client/api_bindings/docs/PostCustomAggregationSpecSchema.md +33 -0
- arthur_client/api_bindings/docs/PutCustomAggregationSpecSchema.md +33 -0
- arthur_client/api_bindings/docs/ReportedCustomAggregation.md +34 -0
- arthur_client/api_bindings/docs/ResourceKind.md +2 -0
- arthur_client/api_bindings/docs/RuleType.md +0 -4
- arthur_client/api_bindings/docs/ValidationOutcome.md +13 -0
- arthur_client/api_bindings/docs/ValidationResult.md +31 -0
- arthur_client/api_bindings/docs/ValidationResults.md +30 -0
- arthur_client/api_bindings/models/__init__.py +12 -1
- arthur_client/api_bindings/models/base_column_parameter_schema.py +125 -0
- arthur_client/api_bindings/models/{metrics_column_list_parameter_schema_allowed_column_types_inner.py → base_column_parameter_schema_allowed_column_types_inner.py} +7 -7
- arthur_client/api_bindings/models/base_dataset_parameter_schema.py +111 -0
- arthur_client/api_bindings/models/base_literal_parameter_schema.py +106 -0
- arthur_client/api_bindings/models/custom_aggregation_spec_schema.py +126 -0
- arthur_client/api_bindings/models/custom_aggregation_spec_schema_aggregate_args_inner.py +149 -0
- arthur_client/api_bindings/models/metrics_column_list_parameter_schema.py +7 -7
- arthur_client/api_bindings/models/metrics_column_parameter_schema.py +7 -7
- arthur_client/api_bindings/models/metrics_dataset_parameter_schema.py +4 -4
- arthur_client/api_bindings/models/metrics_literal_parameter_schema.py +4 -4
- arthur_client/api_bindings/models/object_type.py +3 -3
- arthur_client/api_bindings/models/permission_name.py +5 -0
- arthur_client/api_bindings/models/post_custom_aggregation_spec_schema.py +111 -0
- arthur_client/api_bindings/models/put_custom_aggregation_spec_schema.py +111 -0
- arthur_client/api_bindings/models/reported_custom_aggregation.py +98 -0
- arthur_client/api_bindings/models/resource_kind.py +1 -0
- arthur_client/api_bindings/models/rule_type.py +0 -2
- arthur_client/api_bindings/models/validation_outcome.py +37 -0
- arthur_client/api_bindings/models/validation_result.py +90 -0
- arthur_client/api_bindings/models/validation_results.py +95 -0
- arthur_client/api_bindings/test/test_aggregation_spec_schema_init_args_inner.py +1 -1
- arthur_client/api_bindings/test/test_base_column_parameter_schema.py +66 -0
- arthur_client/api_bindings/test/{test_metrics_column_list_parameter_schema_allowed_column_types_inner.py → test_base_column_parameter_schema_allowed_column_types_inner.py} +11 -11
- arthur_client/api_bindings/test/test_base_dataset_parameter_schema.py +58 -0
- arthur_client/api_bindings/test/test_base_literal_parameter_schema.py +59 -0
- arthur_client/api_bindings/test/test_custom_aggregation_spec_schema.py +118 -0
- arthur_client/api_bindings/test/test_custom_aggregation_spec_schema_aggregate_args_inner.py +69 -0
- arthur_client/api_bindings/test/test_custom_aggregations_v1_api.py +66 -0
- arthur_client/api_bindings/test/test_metrics_column_list_parameter_schema.py +2 -2
- arthur_client/api_bindings/test/test_metrics_column_parameter_schema.py +2 -2
- arthur_client/api_bindings/test/test_metrics_dataset_parameter_schema.py +2 -2
- arthur_client/api_bindings/test/test_metrics_literal_parameter_schema.py +2 -2
- arthur_client/api_bindings/test/test_post_custom_aggregation_spec_schema.py +84 -0
- arthur_client/api_bindings/test/test_put_custom_aggregation_spec_schema.py +84 -0
- arthur_client/api_bindings/test/test_reported_custom_aggregation.py +66 -0
- arthur_client/api_bindings/test/test_validation_outcome.py +33 -0
- arthur_client/api_bindings/test/test_validation_result.py +54 -0
- arthur_client/api_bindings/test/test_validation_results.py +60 -0
- arthur_client/api_bindings_README.md +17 -1
- {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1235.dist-info}/METADATA +1 -1
- {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1235.dist-info}/RECORD +69 -33
- arthur_client/api_bindings/docs/MetricsColumnListParameterSchemaAllowedColumnTypesInner.md +0 -31
- {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1235.dist-info}/WHEEL +0 -0
@@ -0,0 +1,106 @@
|
|
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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from arthur_client.api_bindings.models.d_type import DType
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class BaseLiteralParameterSchema(BaseModel):
|
27
|
+
"""
|
28
|
+
BaseLiteralParameterSchema
|
29
|
+
""" # noqa: E501
|
30
|
+
parameter_key: StrictStr = Field(description="Name of the parameter.")
|
31
|
+
friendly_name: StrictStr = Field(description="User facing name of the parameter.")
|
32
|
+
description: StrictStr = Field(description="Description of the parameter.")
|
33
|
+
parameter_type: Optional[StrictStr] = 'literal'
|
34
|
+
parameter_dtype: DType = Field(description="Data type of the parameter.")
|
35
|
+
__properties: ClassVar[List[str]] = ["parameter_key", "friendly_name", "description", "parameter_type", "parameter_dtype"]
|
36
|
+
|
37
|
+
@field_validator('parameter_type')
|
38
|
+
def parameter_type_validate_enum(cls, value):
|
39
|
+
"""Validates the enum"""
|
40
|
+
if value is None:
|
41
|
+
return value
|
42
|
+
|
43
|
+
if value not in set(['literal']):
|
44
|
+
raise ValueError("must be one of enum values ('literal')")
|
45
|
+
return value
|
46
|
+
|
47
|
+
model_config = ConfigDict(
|
48
|
+
populate_by_name=True,
|
49
|
+
validate_assignment=True,
|
50
|
+
protected_namespaces=(),
|
51
|
+
)
|
52
|
+
|
53
|
+
|
54
|
+
def to_str(self) -> str:
|
55
|
+
"""Returns the string representation of the model using alias"""
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
57
|
+
|
58
|
+
def to_json(self) -> str:
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
61
|
+
return json.dumps(self.to_dict())
|
62
|
+
|
63
|
+
@classmethod
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
65
|
+
"""Create an instance of BaseLiteralParameterSchema from a JSON string"""
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
67
|
+
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
70
|
+
|
71
|
+
This has the following differences from calling pydantic's
|
72
|
+
`self.model_dump(by_alias=True)`:
|
73
|
+
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
75
|
+
were set at model initialization. Other fields with value `None`
|
76
|
+
are ignored.
|
77
|
+
"""
|
78
|
+
excluded_fields: Set[str] = set([
|
79
|
+
])
|
80
|
+
|
81
|
+
_dict = self.model_dump(
|
82
|
+
by_alias=True,
|
83
|
+
exclude=excluded_fields,
|
84
|
+
exclude_none=True,
|
85
|
+
)
|
86
|
+
return _dict
|
87
|
+
|
88
|
+
@classmethod
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
90
|
+
"""Create an instance of BaseLiteralParameterSchema from a dict"""
|
91
|
+
if obj is None:
|
92
|
+
return None
|
93
|
+
|
94
|
+
if not isinstance(obj, dict):
|
95
|
+
return cls.model_validate(obj)
|
96
|
+
|
97
|
+
_obj = cls.model_validate({
|
98
|
+
"parameter_key": obj.get("parameter_key"),
|
99
|
+
"friendly_name": obj.get("friendly_name"),
|
100
|
+
"description": obj.get("description"),
|
101
|
+
"parameter_type": obj.get("parameter_type") if obj.get("parameter_type") is not None else 'literal',
|
102
|
+
"parameter_dtype": obj.get("parameter_dtype")
|
103
|
+
})
|
104
|
+
return _obj
|
105
|
+
|
106
|
+
|
@@ -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
|
23
|
+
from arthur_client.api_bindings.models.custom_aggregation_spec_schema_aggregate_args_inner import CustomAggregationSpecSchemaAggregateArgsInner
|
24
|
+
from arthur_client.api_bindings.models.reported_custom_aggregation import ReportedCustomAggregation
|
25
|
+
from arthur_client.api_bindings.models.user import User
|
26
|
+
from typing import Optional, Set
|
27
|
+
from typing_extensions import Self
|
28
|
+
|
29
|
+
class CustomAggregationSpecSchema(BaseModel):
|
30
|
+
"""
|
31
|
+
CustomAggregationSpecSchema
|
32
|
+
""" # noqa: E501
|
33
|
+
name: StrictStr = Field(description="Name of the custom aggregation function.")
|
34
|
+
description: StrictStr = Field(description="Description of the custom aggregation function and what it aggregates.")
|
35
|
+
reported_aggregations: List[ReportedCustomAggregation] = Field(description="Metadata for every aggregation the custom aggregation reports.")
|
36
|
+
aggregate_args: List[CustomAggregationSpecSchemaAggregateArgsInner] = Field(description="List of parameters to the custom aggregation's query function.")
|
37
|
+
sql: StrictStr = Field(description="DuckDBSQL query for the custom aggregation.")
|
38
|
+
id: StrictStr = Field(description="Unique identifier of the custom aggregation function.")
|
39
|
+
workspace_id: StrictStr = Field(description="Unique identifier of the custom aggregation's parent workspace.")
|
40
|
+
version: StrictInt = Field(description="Version number of the custom aggregation function.")
|
41
|
+
authored_by: User = Field(description="User who authored this custom aggregation.")
|
42
|
+
created_at: datetime = Field(description="Time of aggregation creation.")
|
43
|
+
__properties: ClassVar[List[str]] = ["name", "description", "reported_aggregations", "aggregate_args", "sql", "id", "workspace_id", "version", "authored_by", "created_at"]
|
44
|
+
|
45
|
+
model_config = ConfigDict(
|
46
|
+
populate_by_name=True,
|
47
|
+
validate_assignment=True,
|
48
|
+
protected_namespaces=(),
|
49
|
+
)
|
50
|
+
|
51
|
+
|
52
|
+
def to_str(self) -> str:
|
53
|
+
"""Returns the string representation of the model using alias"""
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
55
|
+
|
56
|
+
def to_json(self) -> str:
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
59
|
+
return json.dumps(self.to_dict())
|
60
|
+
|
61
|
+
@classmethod
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
63
|
+
"""Create an instance of CustomAggregationSpecSchema from a JSON string"""
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
65
|
+
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
68
|
+
|
69
|
+
This has the following differences from calling pydantic's
|
70
|
+
`self.model_dump(by_alias=True)`:
|
71
|
+
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
73
|
+
were set at model initialization. Other fields with value `None`
|
74
|
+
are ignored.
|
75
|
+
"""
|
76
|
+
excluded_fields: Set[str] = set([
|
77
|
+
])
|
78
|
+
|
79
|
+
_dict = self.model_dump(
|
80
|
+
by_alias=True,
|
81
|
+
exclude=excluded_fields,
|
82
|
+
exclude_none=True,
|
83
|
+
)
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of each item in reported_aggregations (list)
|
85
|
+
_items = []
|
86
|
+
if self.reported_aggregations:
|
87
|
+
for _item_reported_aggregations in self.reported_aggregations:
|
88
|
+
if _item_reported_aggregations:
|
89
|
+
_items.append(_item_reported_aggregations.to_dict())
|
90
|
+
_dict['reported_aggregations'] = _items
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in aggregate_args (list)
|
92
|
+
_items = []
|
93
|
+
if self.aggregate_args:
|
94
|
+
for _item_aggregate_args in self.aggregate_args:
|
95
|
+
if _item_aggregate_args:
|
96
|
+
_items.append(_item_aggregate_args.to_dict())
|
97
|
+
_dict['aggregate_args'] = _items
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of authored_by
|
99
|
+
if self.authored_by:
|
100
|
+
_dict['authored_by'] = self.authored_by.to_dict()
|
101
|
+
return _dict
|
102
|
+
|
103
|
+
@classmethod
|
104
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
105
|
+
"""Create an instance of CustomAggregationSpecSchema from a dict"""
|
106
|
+
if obj is None:
|
107
|
+
return None
|
108
|
+
|
109
|
+
if not isinstance(obj, dict):
|
110
|
+
return cls.model_validate(obj)
|
111
|
+
|
112
|
+
_obj = cls.model_validate({
|
113
|
+
"name": obj.get("name"),
|
114
|
+
"description": obj.get("description"),
|
115
|
+
"reported_aggregations": [ReportedCustomAggregation.from_dict(_item) for _item in obj["reported_aggregations"]] if obj.get("reported_aggregations") is not None else None,
|
116
|
+
"aggregate_args": [CustomAggregationSpecSchemaAggregateArgsInner.from_dict(_item) for _item in obj["aggregate_args"]] if obj.get("aggregate_args") is not None else None,
|
117
|
+
"sql": obj.get("sql"),
|
118
|
+
"id": obj.get("id"),
|
119
|
+
"workspace_id": obj.get("workspace_id"),
|
120
|
+
"version": obj.get("version"),
|
121
|
+
"authored_by": User.from_dict(obj["authored_by"]) if obj.get("authored_by") is not None else None,
|
122
|
+
"created_at": obj.get("created_at")
|
123
|
+
})
|
124
|
+
return _obj
|
125
|
+
|
126
|
+
|
@@ -0,0 +1,149 @@
|
|
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
|
+
from inspect import getfullargspec
|
17
|
+
import json
|
18
|
+
import pprint
|
19
|
+
import re # noqa: F401
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
21
|
+
from typing import Optional
|
22
|
+
from arthur_client.api_bindings.models.base_column_parameter_schema import BaseColumnParameterSchema
|
23
|
+
from arthur_client.api_bindings.models.base_dataset_parameter_schema import BaseDatasetParameterSchema
|
24
|
+
from arthur_client.api_bindings.models.base_literal_parameter_schema import BaseLiteralParameterSchema
|
25
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
26
|
+
from typing_extensions import Literal, Self
|
27
|
+
from pydantic import Field
|
28
|
+
|
29
|
+
CUSTOMAGGREGATIONSPECSCHEMAAGGREGATEARGSINNER_ANY_OF_SCHEMAS = ["BaseColumnParameterSchema", "BaseDatasetParameterSchema", "BaseLiteralParameterSchema"]
|
30
|
+
|
31
|
+
class CustomAggregationSpecSchemaAggregateArgsInner(BaseModel):
|
32
|
+
"""
|
33
|
+
CustomAggregationSpecSchemaAggregateArgsInner
|
34
|
+
"""
|
35
|
+
|
36
|
+
# data type: BaseDatasetParameterSchema
|
37
|
+
anyof_schema_1_validator: Optional[BaseDatasetParameterSchema] = None
|
38
|
+
# data type: BaseLiteralParameterSchema
|
39
|
+
anyof_schema_2_validator: Optional[BaseLiteralParameterSchema] = None
|
40
|
+
# data type: BaseColumnParameterSchema
|
41
|
+
anyof_schema_3_validator: Optional[BaseColumnParameterSchema] = None
|
42
|
+
if TYPE_CHECKING:
|
43
|
+
actual_instance: Optional[Union[BaseColumnParameterSchema, BaseDatasetParameterSchema, BaseLiteralParameterSchema]] = None
|
44
|
+
else:
|
45
|
+
actual_instance: Any = None
|
46
|
+
any_of_schemas: Set[str] = { "BaseColumnParameterSchema", "BaseDatasetParameterSchema", "BaseLiteralParameterSchema" }
|
47
|
+
|
48
|
+
model_config = {
|
49
|
+
"validate_assignment": True,
|
50
|
+
"protected_namespaces": (),
|
51
|
+
}
|
52
|
+
|
53
|
+
def __init__(self, *args, **kwargs) -> None:
|
54
|
+
if args:
|
55
|
+
if len(args) > 1:
|
56
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
57
|
+
if kwargs:
|
58
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
59
|
+
super().__init__(actual_instance=args[0])
|
60
|
+
else:
|
61
|
+
super().__init__(**kwargs)
|
62
|
+
|
63
|
+
@field_validator('actual_instance')
|
64
|
+
def actual_instance_must_validate_anyof(cls, v):
|
65
|
+
instance = CustomAggregationSpecSchemaAggregateArgsInner.model_construct()
|
66
|
+
error_messages = []
|
67
|
+
# validate data type: BaseDatasetParameterSchema
|
68
|
+
if not isinstance(v, BaseDatasetParameterSchema):
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BaseDatasetParameterSchema`")
|
70
|
+
else:
|
71
|
+
return v
|
72
|
+
|
73
|
+
# validate data type: BaseLiteralParameterSchema
|
74
|
+
if not isinstance(v, BaseLiteralParameterSchema):
|
75
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BaseLiteralParameterSchema`")
|
76
|
+
else:
|
77
|
+
return v
|
78
|
+
|
79
|
+
# validate data type: BaseColumnParameterSchema
|
80
|
+
if not isinstance(v, BaseColumnParameterSchema):
|
81
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BaseColumnParameterSchema`")
|
82
|
+
else:
|
83
|
+
return v
|
84
|
+
|
85
|
+
if error_messages:
|
86
|
+
# no match
|
87
|
+
raise ValueError("No match found when setting the actual_instance in CustomAggregationSpecSchemaAggregateArgsInner with anyOf schemas: BaseColumnParameterSchema, BaseDatasetParameterSchema, BaseLiteralParameterSchema. Details: " + ", ".join(error_messages))
|
88
|
+
else:
|
89
|
+
return v
|
90
|
+
|
91
|
+
@classmethod
|
92
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
93
|
+
return cls.from_json(json.dumps(obj))
|
94
|
+
|
95
|
+
@classmethod
|
96
|
+
def from_json(cls, json_str: str) -> Self:
|
97
|
+
"""Returns the object represented by the json string"""
|
98
|
+
instance = cls.model_construct()
|
99
|
+
error_messages = []
|
100
|
+
# anyof_schema_1_validator: Optional[BaseDatasetParameterSchema] = None
|
101
|
+
try:
|
102
|
+
instance.actual_instance = BaseDatasetParameterSchema.from_json(json_str)
|
103
|
+
return instance
|
104
|
+
except (ValidationError, ValueError) as e:
|
105
|
+
error_messages.append(str(e))
|
106
|
+
# anyof_schema_2_validator: Optional[BaseLiteralParameterSchema] = None
|
107
|
+
try:
|
108
|
+
instance.actual_instance = BaseLiteralParameterSchema.from_json(json_str)
|
109
|
+
return instance
|
110
|
+
except (ValidationError, ValueError) as e:
|
111
|
+
error_messages.append(str(e))
|
112
|
+
# anyof_schema_3_validator: Optional[BaseColumnParameterSchema] = None
|
113
|
+
try:
|
114
|
+
instance.actual_instance = BaseColumnParameterSchema.from_json(json_str)
|
115
|
+
return instance
|
116
|
+
except (ValidationError, ValueError) as e:
|
117
|
+
error_messages.append(str(e))
|
118
|
+
|
119
|
+
if error_messages:
|
120
|
+
# no match
|
121
|
+
raise ValueError("No match found when deserializing the JSON string into CustomAggregationSpecSchemaAggregateArgsInner with anyOf schemas: BaseColumnParameterSchema, BaseDatasetParameterSchema, BaseLiteralParameterSchema. Details: " + ", ".join(error_messages))
|
122
|
+
else:
|
123
|
+
return instance
|
124
|
+
|
125
|
+
def to_json(self) -> str:
|
126
|
+
"""Returns the JSON representation of the actual instance"""
|
127
|
+
if self.actual_instance is None:
|
128
|
+
return "null"
|
129
|
+
|
130
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
131
|
+
return self.actual_instance.to_json()
|
132
|
+
else:
|
133
|
+
return json.dumps(self.actual_instance)
|
134
|
+
|
135
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], BaseColumnParameterSchema, BaseDatasetParameterSchema, BaseLiteralParameterSchema]]:
|
136
|
+
"""Returns the dict representation of the actual instance"""
|
137
|
+
if self.actual_instance is None:
|
138
|
+
return None
|
139
|
+
|
140
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
141
|
+
return self.actual_instance.to_dict()
|
142
|
+
else:
|
143
|
+
return self.actual_instance
|
144
|
+
|
145
|
+
def to_str(self) -> str:
|
146
|
+
"""Returns the string representation of the actual instance"""
|
147
|
+
return pprint.pformat(self.model_dump())
|
148
|
+
|
149
|
+
|
@@ -19,7 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from arthur_client.api_bindings.models.
|
22
|
+
from arthur_client.api_bindings.models.base_column_parameter_schema_allowed_column_types_inner import BaseColumnParameterSchemaAllowedColumnTypesInner
|
23
23
|
from arthur_client.api_bindings.models.scope_schema_tag import ScopeSchemaTag
|
24
24
|
from typing import Optional, Set
|
25
25
|
from typing_extensions import Self
|
@@ -29,15 +29,15 @@ class MetricsColumnListParameterSchema(BaseModel):
|
|
29
29
|
MetricsColumnListParameterSchema
|
30
30
|
""" # noqa: E501
|
31
31
|
parameter_key: StrictStr = Field(description="Name of the parameter.")
|
32
|
-
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
33
32
|
friendly_name: StrictStr = Field(description="User facing name of the parameter.")
|
34
33
|
description: StrictStr = Field(description="Description of the parameter.")
|
35
34
|
tag_hints: Optional[List[ScopeSchemaTag]] = Field(default=None, description="List of tags that are applicable to this parameter. Datasets with columns that have matching tags can be inferred this way.")
|
36
35
|
source_dataset_parameter_key: StrictStr = Field(description="Name of the parameter that provides the dataset to be used for this column.")
|
37
|
-
allowed_column_types: Optional[List[
|
36
|
+
allowed_column_types: Optional[List[BaseColumnParameterSchemaAllowedColumnTypesInner]] = None
|
38
37
|
allow_any_column_type: Optional[StrictBool] = Field(default=False, description="Indicates if this metric parameter can accept any column type.")
|
39
38
|
parameter_type: Optional[StrictStr] = 'column_list'
|
40
|
-
|
39
|
+
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
40
|
+
__properties: ClassVar[List[str]] = ["parameter_key", "friendly_name", "description", "tag_hints", "source_dataset_parameter_key", "allowed_column_types", "allow_any_column_type", "parameter_type", "optional"]
|
41
41
|
|
42
42
|
@field_validator('parameter_type')
|
43
43
|
def parameter_type_validate_enum(cls, value):
|
@@ -113,14 +113,14 @@ class MetricsColumnListParameterSchema(BaseModel):
|
|
113
113
|
|
114
114
|
_obj = cls.model_validate({
|
115
115
|
"parameter_key": obj.get("parameter_key"),
|
116
|
-
"optional": obj.get("optional") if obj.get("optional") is not None else False,
|
117
116
|
"friendly_name": obj.get("friendly_name"),
|
118
117
|
"description": obj.get("description"),
|
119
118
|
"tag_hints": obj.get("tag_hints"),
|
120
119
|
"source_dataset_parameter_key": obj.get("source_dataset_parameter_key"),
|
121
|
-
"allowed_column_types": [
|
120
|
+
"allowed_column_types": [BaseColumnParameterSchemaAllowedColumnTypesInner.from_dict(_item) for _item in obj["allowed_column_types"]] if obj.get("allowed_column_types") is not None else None,
|
122
121
|
"allow_any_column_type": obj.get("allow_any_column_type") if obj.get("allow_any_column_type") is not None else False,
|
123
|
-
"parameter_type": obj.get("parameter_type") if obj.get("parameter_type") is not None else 'column_list'
|
122
|
+
"parameter_type": obj.get("parameter_type") if obj.get("parameter_type") is not None else 'column_list',
|
123
|
+
"optional": obj.get("optional") if obj.get("optional") is not None else False
|
124
124
|
})
|
125
125
|
return _obj
|
126
126
|
|
@@ -19,7 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from arthur_client.api_bindings.models.
|
22
|
+
from arthur_client.api_bindings.models.base_column_parameter_schema_allowed_column_types_inner import BaseColumnParameterSchemaAllowedColumnTypesInner
|
23
23
|
from arthur_client.api_bindings.models.scope_schema_tag import ScopeSchemaTag
|
24
24
|
from typing import Optional, Set
|
25
25
|
from typing_extensions import Self
|
@@ -29,15 +29,15 @@ class MetricsColumnParameterSchema(BaseModel):
|
|
29
29
|
MetricsColumnParameterSchema
|
30
30
|
""" # noqa: E501
|
31
31
|
parameter_key: StrictStr = Field(description="Name of the parameter.")
|
32
|
-
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
33
32
|
friendly_name: StrictStr = Field(description="User facing name of the parameter.")
|
34
33
|
description: StrictStr = Field(description="Description of the parameter.")
|
35
34
|
tag_hints: Optional[List[ScopeSchemaTag]] = Field(default=None, description="List of tags that are applicable to this parameter. Datasets with columns that have matching tags can be inferred this way.")
|
36
35
|
source_dataset_parameter_key: StrictStr = Field(description="Name of the parameter that provides the dataset to be used for this column.")
|
37
|
-
allowed_column_types: Optional[List[
|
36
|
+
allowed_column_types: Optional[List[BaseColumnParameterSchemaAllowedColumnTypesInner]] = None
|
38
37
|
allow_any_column_type: Optional[StrictBool] = Field(default=False, description="Indicates if this metric parameter can accept any column type.")
|
39
38
|
parameter_type: Optional[StrictStr] = 'column'
|
40
|
-
|
39
|
+
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
40
|
+
__properties: ClassVar[List[str]] = ["parameter_key", "friendly_name", "description", "tag_hints", "source_dataset_parameter_key", "allowed_column_types", "allow_any_column_type", "parameter_type", "optional"]
|
41
41
|
|
42
42
|
@field_validator('parameter_type')
|
43
43
|
def parameter_type_validate_enum(cls, value):
|
@@ -113,14 +113,14 @@ class MetricsColumnParameterSchema(BaseModel):
|
|
113
113
|
|
114
114
|
_obj = cls.model_validate({
|
115
115
|
"parameter_key": obj.get("parameter_key"),
|
116
|
-
"optional": obj.get("optional") if obj.get("optional") is not None else False,
|
117
116
|
"friendly_name": obj.get("friendly_name"),
|
118
117
|
"description": obj.get("description"),
|
119
118
|
"tag_hints": obj.get("tag_hints"),
|
120
119
|
"source_dataset_parameter_key": obj.get("source_dataset_parameter_key"),
|
121
|
-
"allowed_column_types": [
|
120
|
+
"allowed_column_types": [BaseColumnParameterSchemaAllowedColumnTypesInner.from_dict(_item) for _item in obj["allowed_column_types"]] if obj.get("allowed_column_types") is not None else None,
|
122
121
|
"allow_any_column_type": obj.get("allow_any_column_type") if obj.get("allow_any_column_type") is not None else False,
|
123
|
-
"parameter_type": obj.get("parameter_type") if obj.get("parameter_type") is not None else 'column'
|
122
|
+
"parameter_type": obj.get("parameter_type") if obj.get("parameter_type") is not None else 'column',
|
123
|
+
"optional": obj.get("optional") if obj.get("optional") is not None else False
|
124
124
|
})
|
125
125
|
return _obj
|
126
126
|
|
@@ -28,12 +28,12 @@ class MetricsDatasetParameterSchema(BaseModel):
|
|
28
28
|
MetricsDatasetParameterSchema
|
29
29
|
""" # noqa: E501
|
30
30
|
parameter_key: StrictStr = Field(description="Name of the parameter.")
|
31
|
-
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
32
31
|
friendly_name: StrictStr = Field(description="User facing name of the parameter.")
|
33
32
|
description: StrictStr = Field(description="Description of the parameter.")
|
34
33
|
parameter_type: Optional[StrictStr] = 'dataset'
|
35
34
|
model_problem_type: Optional[ModelProblemType] = None
|
36
|
-
|
35
|
+
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
36
|
+
__properties: ClassVar[List[str]] = ["parameter_key", "friendly_name", "description", "parameter_type", "model_problem_type", "optional"]
|
37
37
|
|
38
38
|
@field_validator('parameter_type')
|
39
39
|
def parameter_type_validate_enum(cls, value):
|
@@ -102,11 +102,11 @@ class MetricsDatasetParameterSchema(BaseModel):
|
|
102
102
|
|
103
103
|
_obj = cls.model_validate({
|
104
104
|
"parameter_key": obj.get("parameter_key"),
|
105
|
-
"optional": obj.get("optional") if obj.get("optional") is not None else False,
|
106
105
|
"friendly_name": obj.get("friendly_name"),
|
107
106
|
"description": obj.get("description"),
|
108
107
|
"parameter_type": obj.get("parameter_type") if obj.get("parameter_type") is not None else 'dataset',
|
109
|
-
"model_problem_type": obj.get("model_problem_type")
|
108
|
+
"model_problem_type": obj.get("model_problem_type"),
|
109
|
+
"optional": obj.get("optional") if obj.get("optional") is not None else False
|
110
110
|
})
|
111
111
|
return _obj
|
112
112
|
|
@@ -28,12 +28,12 @@ class MetricsLiteralParameterSchema(BaseModel):
|
|
28
28
|
MetricsLiteralParameterSchema
|
29
29
|
""" # noqa: E501
|
30
30
|
parameter_key: StrictStr = Field(description="Name of the parameter.")
|
31
|
-
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
32
31
|
friendly_name: StrictStr = Field(description="User facing name of the parameter.")
|
33
32
|
description: StrictStr = Field(description="Description of the parameter.")
|
34
33
|
parameter_type: Optional[StrictStr] = 'literal'
|
35
34
|
parameter_dtype: DType = Field(description="Data type of the parameter.")
|
36
|
-
|
35
|
+
optional: Optional[StrictBool] = Field(default=False, description="Boolean denoting if the parameter is optional.")
|
36
|
+
__properties: ClassVar[List[str]] = ["parameter_key", "friendly_name", "description", "parameter_type", "parameter_dtype", "optional"]
|
37
37
|
|
38
38
|
@field_validator('parameter_type')
|
39
39
|
def parameter_type_validate_enum(cls, value):
|
@@ -97,11 +97,11 @@ class MetricsLiteralParameterSchema(BaseModel):
|
|
97
97
|
|
98
98
|
_obj = cls.model_validate({
|
99
99
|
"parameter_key": obj.get("parameter_key"),
|
100
|
-
"optional": obj.get("optional") if obj.get("optional") is not None else False,
|
101
100
|
"friendly_name": obj.get("friendly_name"),
|
102
101
|
"description": obj.get("description"),
|
103
102
|
"parameter_type": obj.get("parameter_type") if obj.get("parameter_type") is not None else 'literal',
|
104
|
-
"parameter_dtype": obj.get("parameter_dtype")
|
103
|
+
"parameter_dtype": obj.get("parameter_dtype"),
|
104
|
+
"optional": obj.get("optional") if obj.get("optional") is not None else False
|
105
105
|
})
|
106
106
|
return _obj
|
107
107
|
|
@@ -26,7 +26,7 @@ class ObjectType(BaseModel):
|
|
26
26
|
"""
|
27
27
|
ObjectType
|
28
28
|
""" # noqa: E501
|
29
|
-
object: Dict[str,
|
29
|
+
object: Dict[str, BaseColumnParameterSchemaAllowedColumnTypesInner]
|
30
30
|
__properties: ClassVar[List[str]] = ["object"]
|
31
31
|
|
32
32
|
model_config = ConfigDict(
|
@@ -88,7 +88,7 @@ class ObjectType(BaseModel):
|
|
88
88
|
|
89
89
|
_obj = cls.model_validate({
|
90
90
|
"object": dict(
|
91
|
-
(_k,
|
91
|
+
(_k, BaseColumnParameterSchemaAllowedColumnTypesInner.from_dict(_v))
|
92
92
|
for _k, _v in obj["object"].items()
|
93
93
|
)
|
94
94
|
if obj.get("object") is not None
|
@@ -96,7 +96,7 @@ class ObjectType(BaseModel):
|
|
96
96
|
})
|
97
97
|
return _obj
|
98
98
|
|
99
|
-
from arthur_client.api_bindings.models.
|
99
|
+
from arthur_client.api_bindings.models.base_column_parameter_schema_allowed_column_types_inner import BaseColumnParameterSchemaAllowedColumnTypesInner
|
100
100
|
# TODO: Rewrite to not use raise_errors
|
101
101
|
ObjectType.model_rebuild(raise_errors=False)
|
102
102
|
|
@@ -68,6 +68,8 @@ class PermissionName(str, Enum):
|
|
68
68
|
WORKSPACE_CREATE_WEBHOOK = 'workspace_create_webhook'
|
69
69
|
WORKSPACE_LIST_WEBHOOKS = 'workspace_list_webhooks'
|
70
70
|
WORKSPACE_TEST_WEBHOOK = 'workspace_test_webhook'
|
71
|
+
WORKSPACE_CREATE_CUSTOM_AGGREGATION = 'workspace_create_custom_aggregation'
|
72
|
+
WORKSPACE_VALIDATE_CUSTOM_AGGREGATION = 'workspace_validate_custom_aggregation'
|
71
73
|
PROJECT_READ = 'project_read'
|
72
74
|
PROJECT_UPDATE = 'project_update'
|
73
75
|
PROJECT_DELETE = 'project_delete'
|
@@ -158,6 +160,9 @@ class PermissionName(str, Enum):
|
|
158
160
|
WEBHOOK_UPDATE = 'webhook_update'
|
159
161
|
WEBHOOK_DELETE = 'webhook_delete'
|
160
162
|
ROLE_READ = 'role_read'
|
163
|
+
CUSTOM_AGGREGATION_READ = 'custom_aggregation_read'
|
164
|
+
CUSTOM_AGGREGATION_PUT = 'custom_aggregation_put'
|
165
|
+
CUSTOM_AGGREGATION_DELETE = 'custom_aggregation_delete'
|
161
166
|
|
162
167
|
@classmethod
|
163
168
|
def from_json(cls, json_str: str) -> Self:
|