arthur-client 1.4.1233__py3-none-any.whl → 1.4.1234__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.
Files changed (70) hide show
  1. arthur_client/api_bindings/__init__.py +13 -1
  2. arthur_client/api_bindings/api/__init__.py +1 -0
  3. arthur_client/api_bindings/api/custom_aggregations_v1_api.py +1477 -0
  4. arthur_client/api_bindings/docs/AggregationSpecSchemaInitArgsInner.md +2 -2
  5. arthur_client/api_bindings/docs/BaseColumnParameterSchema.md +36 -0
  6. arthur_client/api_bindings/docs/BaseColumnParameterSchemaAllowedColumnTypesInner.md +31 -0
  7. arthur_client/api_bindings/docs/BaseDatasetParameterSchema.md +33 -0
  8. arthur_client/api_bindings/docs/BaseLiteralParameterSchema.md +33 -0
  9. arthur_client/api_bindings/docs/CustomAggregationSpecSchema.md +38 -0
  10. arthur_client/api_bindings/docs/CustomAggregationSpecSchemaAggregateArgsInner.md +38 -0
  11. arthur_client/api_bindings/docs/CustomAggregationsV1Api.md +410 -0
  12. arthur_client/api_bindings/docs/Items1.md +1 -1
  13. arthur_client/api_bindings/docs/MetricsColumnListParameterSchema.md +2 -2
  14. arthur_client/api_bindings/docs/MetricsColumnParameterSchema.md +2 -2
  15. arthur_client/api_bindings/docs/MetricsDatasetParameterSchema.md +1 -1
  16. arthur_client/api_bindings/docs/MetricsLiteralParameterSchema.md +1 -1
  17. arthur_client/api_bindings/docs/ObjectType.md +1 -1
  18. arthur_client/api_bindings/docs/PermissionName.md +10 -0
  19. arthur_client/api_bindings/docs/PostCustomAggregationSpecSchema.md +33 -0
  20. arthur_client/api_bindings/docs/PutCustomAggregationSpecSchema.md +33 -0
  21. arthur_client/api_bindings/docs/ReportedCustomAggregation.md +34 -0
  22. arthur_client/api_bindings/docs/ResourceKind.md +2 -0
  23. arthur_client/api_bindings/docs/RuleType.md +0 -4
  24. arthur_client/api_bindings/docs/ValidationOutcome.md +13 -0
  25. arthur_client/api_bindings/docs/ValidationResult.md +31 -0
  26. arthur_client/api_bindings/docs/ValidationResults.md +30 -0
  27. arthur_client/api_bindings/models/__init__.py +12 -1
  28. arthur_client/api_bindings/models/base_column_parameter_schema.py +125 -0
  29. 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
  30. arthur_client/api_bindings/models/base_dataset_parameter_schema.py +111 -0
  31. arthur_client/api_bindings/models/base_literal_parameter_schema.py +106 -0
  32. arthur_client/api_bindings/models/custom_aggregation_spec_schema.py +126 -0
  33. arthur_client/api_bindings/models/custom_aggregation_spec_schema_aggregate_args_inner.py +149 -0
  34. arthur_client/api_bindings/models/metrics_column_list_parameter_schema.py +7 -7
  35. arthur_client/api_bindings/models/metrics_column_parameter_schema.py +7 -7
  36. arthur_client/api_bindings/models/metrics_dataset_parameter_schema.py +4 -4
  37. arthur_client/api_bindings/models/metrics_literal_parameter_schema.py +4 -4
  38. arthur_client/api_bindings/models/object_type.py +3 -3
  39. arthur_client/api_bindings/models/permission_name.py +5 -0
  40. arthur_client/api_bindings/models/post_custom_aggregation_spec_schema.py +111 -0
  41. arthur_client/api_bindings/models/put_custom_aggregation_spec_schema.py +111 -0
  42. arthur_client/api_bindings/models/reported_custom_aggregation.py +98 -0
  43. arthur_client/api_bindings/models/resource_kind.py +1 -0
  44. arthur_client/api_bindings/models/rule_type.py +0 -2
  45. arthur_client/api_bindings/models/validation_outcome.py +37 -0
  46. arthur_client/api_bindings/models/validation_result.py +90 -0
  47. arthur_client/api_bindings/models/validation_results.py +95 -0
  48. arthur_client/api_bindings/test/test_aggregation_spec_schema_init_args_inner.py +1 -1
  49. arthur_client/api_bindings/test/test_base_column_parameter_schema.py +66 -0
  50. 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
  51. arthur_client/api_bindings/test/test_base_dataset_parameter_schema.py +58 -0
  52. arthur_client/api_bindings/test/test_base_literal_parameter_schema.py +59 -0
  53. arthur_client/api_bindings/test/test_custom_aggregation_spec_schema.py +118 -0
  54. arthur_client/api_bindings/test/test_custom_aggregation_spec_schema_aggregate_args_inner.py +69 -0
  55. arthur_client/api_bindings/test/test_custom_aggregations_v1_api.py +66 -0
  56. arthur_client/api_bindings/test/test_metrics_column_list_parameter_schema.py +2 -2
  57. arthur_client/api_bindings/test/test_metrics_column_parameter_schema.py +2 -2
  58. arthur_client/api_bindings/test/test_metrics_dataset_parameter_schema.py +2 -2
  59. arthur_client/api_bindings/test/test_metrics_literal_parameter_schema.py +2 -2
  60. arthur_client/api_bindings/test/test_post_custom_aggregation_spec_schema.py +84 -0
  61. arthur_client/api_bindings/test/test_put_custom_aggregation_spec_schema.py +84 -0
  62. arthur_client/api_bindings/test/test_reported_custom_aggregation.py +66 -0
  63. arthur_client/api_bindings/test/test_validation_outcome.py +33 -0
  64. arthur_client/api_bindings/test/test_validation_result.py +54 -0
  65. arthur_client/api_bindings/test/test_validation_results.py +60 -0
  66. arthur_client/api_bindings_README.md +17 -1
  67. {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1234.dist-info}/METADATA +1 -1
  68. {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1234.dist-info}/RECORD +69 -33
  69. arthur_client/api_bindings/docs/MetricsColumnListParameterSchemaAllowedColumnTypesInner.md +0 -31
  70. {arthur_client-1.4.1233.dist-info → arthur_client-1.4.1234.dist-info}/WHEEL +0 -0
@@ -0,0 +1,111 @@
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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from arthur_client.api_bindings.models.custom_aggregation_spec_schema_aggregate_args_inner import CustomAggregationSpecSchemaAggregateArgsInner
23
+ from arthur_client.api_bindings.models.reported_custom_aggregation import ReportedCustomAggregation
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class PostCustomAggregationSpecSchema(BaseModel):
28
+ """
29
+ PostCustomAggregationSpecSchema
30
+ """ # noqa: E501
31
+ name: StrictStr = Field(description="Name of the custom aggregation function.")
32
+ description: StrictStr = Field(description="Description of the custom aggregation function and what it aggregates.")
33
+ reported_aggregations: List[ReportedCustomAggregation] = Field(description="Metadata for every aggregation the custom aggregation reports.")
34
+ aggregate_args: List[CustomAggregationSpecSchemaAggregateArgsInner] = Field(description="List of parameters to the custom aggregation's query function.")
35
+ sql: StrictStr = Field(description="DuckDBSQL query for the custom aggregation.")
36
+ __properties: ClassVar[List[str]] = ["name", "description", "reported_aggregations", "aggregate_args", "sql"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of PostCustomAggregationSpecSchema from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # override the default output from pydantic by calling `to_dict()` of each item in reported_aggregations (list)
78
+ _items = []
79
+ if self.reported_aggregations:
80
+ for _item_reported_aggregations in self.reported_aggregations:
81
+ if _item_reported_aggregations:
82
+ _items.append(_item_reported_aggregations.to_dict())
83
+ _dict['reported_aggregations'] = _items
84
+ # override the default output from pydantic by calling `to_dict()` of each item in aggregate_args (list)
85
+ _items = []
86
+ if self.aggregate_args:
87
+ for _item_aggregate_args in self.aggregate_args:
88
+ if _item_aggregate_args:
89
+ _items.append(_item_aggregate_args.to_dict())
90
+ _dict['aggregate_args'] = _items
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of PostCustomAggregationSpecSchema from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "name": obj.get("name"),
104
+ "description": obj.get("description"),
105
+ "reported_aggregations": [ReportedCustomAggregation.from_dict(_item) for _item in obj["reported_aggregations"]] if obj.get("reported_aggregations") is not None else None,
106
+ "aggregate_args": [CustomAggregationSpecSchemaAggregateArgsInner.from_dict(_item) for _item in obj["aggregate_args"]] if obj.get("aggregate_args") is not None else None,
107
+ "sql": obj.get("sql")
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,111 @@
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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from arthur_client.api_bindings.models.custom_aggregation_spec_schema_aggregate_args_inner import CustomAggregationSpecSchemaAggregateArgsInner
23
+ from arthur_client.api_bindings.models.reported_custom_aggregation import ReportedCustomAggregation
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class PutCustomAggregationSpecSchema(BaseModel):
28
+ """
29
+ PutCustomAggregationSpecSchema
30
+ """ # noqa: E501
31
+ name: StrictStr = Field(description="Name of the custom aggregation function.")
32
+ description: StrictStr = Field(description="Description of the custom aggregation function and what it aggregates.")
33
+ reported_aggregations: List[ReportedCustomAggregation] = Field(description="Metadata for every aggregation the custom aggregation reports.")
34
+ aggregate_args: List[CustomAggregationSpecSchemaAggregateArgsInner] = Field(description="List of parameters to the custom aggregation's query function.")
35
+ sql: StrictStr = Field(description="DuckDBSQL query for the custom aggregation.")
36
+ __properties: ClassVar[List[str]] = ["name", "description", "reported_aggregations", "aggregate_args", "sql"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of PutCustomAggregationSpecSchema from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # override the default output from pydantic by calling `to_dict()` of each item in reported_aggregations (list)
78
+ _items = []
79
+ if self.reported_aggregations:
80
+ for _item_reported_aggregations in self.reported_aggregations:
81
+ if _item_reported_aggregations:
82
+ _items.append(_item_reported_aggregations.to_dict())
83
+ _dict['reported_aggregations'] = _items
84
+ # override the default output from pydantic by calling `to_dict()` of each item in aggregate_args (list)
85
+ _items = []
86
+ if self.aggregate_args:
87
+ for _item_aggregate_args in self.aggregate_args:
88
+ if _item_aggregate_args:
89
+ _items.append(_item_aggregate_args.to_dict())
90
+ _dict['aggregate_args'] = _items
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of PutCustomAggregationSpecSchema from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "name": obj.get("name"),
104
+ "description": obj.get("description"),
105
+ "reported_aggregations": [ReportedCustomAggregation.from_dict(_item) for _item in obj["reported_aggregations"]] if obj.get("reported_aggregations") is not None else None,
106
+ "aggregate_args": [CustomAggregationSpecSchemaAggregateArgsInner.from_dict(_item) for _item in obj["aggregate_args"]] if obj.get("aggregate_args") is not None else None,
107
+ "sql": obj.get("sql")
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,98 @@
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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from arthur_client.api_bindings.models.aggregation_metric_type import AggregationMetricType
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ReportedCustomAggregation(BaseModel):
27
+ """
28
+ ReportedCustomAggregation
29
+ """ # noqa: E501
30
+ metric_name: StrictStr = Field(description="Name of the reported aggregation metric.")
31
+ description: StrictStr = Field(description="Description of the reported aggregation metric and what it aggregates.")
32
+ value_column: StrictStr = Field(description="Name of the column returned from the SQL query holding the metric value.")
33
+ timestamp_column: StrictStr = Field(description="Name of the column returned from the SQL query holding the timestamp buckets.")
34
+ metric_kind: AggregationMetricType = Field(description="Return type of the reported aggregation metric value.")
35
+ dimension_columns: List[StrictStr] = Field(description="Name of any dimension columns returned from the SQL query. Max length is 1.")
36
+ __properties: ClassVar[List[str]] = ["metric_name", "description", "value_column", "timestamp_column", "metric_kind", "dimension_columns"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of ReportedCustomAggregation from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of ReportedCustomAggregation from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "metric_name": obj.get("metric_name"),
90
+ "description": obj.get("description"),
91
+ "value_column": obj.get("value_column"),
92
+ "timestamp_column": obj.get("timestamp_column"),
93
+ "metric_kind": obj.get("metric_kind"),
94
+ "dimension_columns": obj.get("dimension_columns")
95
+ })
96
+ return _obj
97
+
98
+
@@ -42,6 +42,7 @@ class ResourceKind(str, Enum):
42
42
  DATA_PLANE = 'data_plane'
43
43
  ALERT_RULE = 'alert_rule'
44
44
  WEBHOOK = 'webhook'
45
+ CUSTOM_AGGREGATION = 'custom_aggregation'
45
46
 
46
47
  @classmethod
47
48
  def from_json(cls, json_str: str) -> Self:
@@ -27,9 +27,7 @@ class RuleType(str, Enum):
27
27
  allowed enum values
28
28
  """
29
29
  KEYWORDRULE = 'KeywordRule'
30
- MODELHALLUCINATIONRULE = 'ModelHallucinationRule'
31
30
  MODELHALLUCINATIONRULEV2 = 'ModelHallucinationRuleV2'
32
- MODELHALLUCINATIONRULEV3 = 'ModelHallucinationRuleV3'
33
31
  MODELSENSITIVEDATARULE = 'ModelSensitiveDataRule'
34
32
  PIIDATARULE = 'PIIDataRule'
35
33
  PROMPTINJECTIONRULE = 'PromptInjectionRule'
@@ -0,0 +1,37 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class ValidationOutcome(str, Enum):
22
+ """
23
+ Generic class to indicate if a validation passed or failed.
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ PASS = 'pass'
30
+ FAIL = 'fail'
31
+
32
+ @classmethod
33
+ def from_json(cls, json_str: str) -> Self:
34
+ """Create an instance of ValidationOutcome from a JSON string"""
35
+ return cls(json.loads(json_str))
36
+
37
+
@@ -0,0 +1,90 @@
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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from arthur_client.api_bindings.models.validation_outcome import ValidationOutcome
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ValidationResult(BaseModel):
27
+ """
28
+ Generic class to indicate a single validation and its outcome.
29
+ """ # noqa: E501
30
+ validation_description: StrictStr = Field(description="Description of validation requirement.")
31
+ validation_outcome: ValidationOutcome = Field(description="Outcome of the validation requirement.")
32
+ __properties: ClassVar[List[str]] = ["validation_description", "validation_outcome"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of ValidationResult from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of ValidationResult from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "validation_description": obj.get("validation_description"),
86
+ "validation_outcome": obj.get("validation_outcome")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,95 @@
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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from arthur_client.api_bindings.models.validation_result import ValidationResult
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ValidationResults(BaseModel):
27
+ """
28
+ This class is a generic class for any endpoints returning multiple validation errors.
29
+ """ # noqa: E501
30
+ validation_results: List[ValidationResult]
31
+ __properties: ClassVar[List[str]] = ["validation_results"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ValidationResults from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in validation_results (list)
73
+ _items = []
74
+ if self.validation_results:
75
+ for _item_validation_results in self.validation_results:
76
+ if _item_validation_results:
77
+ _items.append(_item_validation_results.to_dict())
78
+ _dict['validation_results'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ValidationResults from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "validation_results": [ValidationResult.from_dict(_item) for _item in obj["validation_results"]] if obj.get("validation_results") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -36,11 +36,11 @@ class TestAggregationSpecSchemaInitArgsInner(unittest.TestCase):
36
36
  if include_optional:
37
37
  return AggregationSpecSchemaInitArgsInner(
38
38
  parameter_key = '',
39
- optional = True,
40
39
  friendly_name = '',
41
40
  description = '',
42
41
  parameter_type = 'column_list',
43
42
  model_problem_type = 'regression',
43
+ optional = True,
44
44
  parameter_dtype = 'undefined',
45
45
  tag_hints = [
46
46
  'llm_context'
@@ -0,0 +1,66 @@
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
+ import unittest
16
+
17
+ from arthur_client.api_bindings.models.base_column_parameter_schema import BaseColumnParameterSchema
18
+
19
+ class TestBaseColumnParameterSchema(unittest.TestCase):
20
+ """BaseColumnParameterSchema unit test stubs"""
21
+
22
+ def setUp(self):
23
+ pass
24
+
25
+ def tearDown(self):
26
+ pass
27
+
28
+ def make_instance(self, include_optional) -> BaseColumnParameterSchema:
29
+ """Test BaseColumnParameterSchema
30
+ include_optional is a boolean, when False only required
31
+ params are included, when True both required and
32
+ optional params are included """
33
+ # uncomment below to create an instance of `BaseColumnParameterSchema`
34
+ """
35
+ model = BaseColumnParameterSchema()
36
+ if include_optional:
37
+ return BaseColumnParameterSchema(
38
+ parameter_key = '',
39
+ friendly_name = '',
40
+ description = '',
41
+ tag_hints = [
42
+ 'llm_context'
43
+ ],
44
+ source_dataset_parameter_key = '',
45
+ allowed_column_types = [
46
+ null
47
+ ],
48
+ allow_any_column_type = True,
49
+ parameter_type = 'column'
50
+ )
51
+ else:
52
+ return BaseColumnParameterSchema(
53
+ parameter_key = '',
54
+ friendly_name = '',
55
+ description = '',
56
+ source_dataset_parameter_key = '',
57
+ )
58
+ """
59
+
60
+ def testBaseColumnParameterSchema(self):
61
+ """Test BaseColumnParameterSchema"""
62
+ # inst_req_only = self.make_instance(include_optional=False)
63
+ # inst_req_and_optional = self.make_instance(include_optional=True)
64
+
65
+ if __name__ == '__main__':
66
+ unittest.main()