rapidata 2.42.0__py3-none-any.whl → 2.42.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

Files changed (35) hide show
  1. rapidata/__init__.py +1 -1
  2. rapidata/api_client/__init__.py +8 -1
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/grouped_ranking_workflow_api.py +318 -0
  5. rapidata/api_client/models/__init__.py +7 -1
  6. rapidata/api_client/models/asset_metadata.py +2 -8
  7. rapidata/api_client/models/create_datapoint_model.py +10 -3
  8. rapidata/api_client/models/create_order_model_workflow.py +23 -9
  9. rapidata/api_client/models/file_asset.py +1 -3
  10. rapidata/api_client/models/file_asset_metadata_value.py +1 -3
  11. rapidata/api_client/models/get_grouped_ranking_workflow_results_model.py +106 -0
  12. rapidata/api_client/models/get_grouped_ranking_workflow_results_result.py +97 -0
  13. rapidata/api_client/models/get_grouped_ranking_workflow_results_result_paged_result.py +105 -0
  14. rapidata/api_client/models/get_workflow_by_id_result_workflow.py +23 -9
  15. rapidata/api_client/models/grouped_ranking_workflow_config.py +143 -0
  16. rapidata/api_client/models/grouped_ranking_workflow_model.py +135 -0
  17. rapidata/api_client/models/grouped_ranking_workflow_model1.py +121 -0
  18. rapidata/api_client/models/multi_asset.py +4 -4
  19. rapidata/api_client/models/multi_asset_assets_inner.py +170 -0
  20. rapidata/api_client/models/null_asset.py +1 -3
  21. rapidata/api_client/models/text_asset.py +1 -3
  22. rapidata/api_client/models/workflow_config_artifact_model_workflow_config.py +23 -9
  23. rapidata/api_client_README.md +8 -1
  24. rapidata/rapidata_client/benchmark/participant/_participant.py +1 -2
  25. rapidata/rapidata_client/order/dataset/_rapidata_dataset.py +1 -3
  26. rapidata/rapidata_client/order/rapidata_order.py +16 -16
  27. rapidata/rapidata_client/order/rapidata_order_manager.py +3 -11
  28. rapidata/rapidata_client/validation/rapids/rapids.py +2 -2
  29. rapidata/rapidata_client/validation/validation_set_manager.py +19 -7
  30. rapidata/rapidata_client/workflow/_base_workflow.py +3 -0
  31. rapidata/rapidata_client/workflow/_ranking_workflow.py +42 -3
  32. {rapidata-2.42.0.dist-info → rapidata-2.42.2.dist-info}/METADATA +1 -1
  33. {rapidata-2.42.0.dist-info → rapidata-2.42.2.dist-info}/RECORD +35 -27
  34. {rapidata-2.42.0.dist-info → rapidata-2.42.2.dist-info}/WHEEL +0 -0
  35. {rapidata-2.42.0.dist-info → rapidata-2.42.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,106 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.page_info import PageInfo
23
+ from rapidata.api_client.models.sort_criterion import SortCriterion
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class GetGroupedRankingWorkflowResultsModel(BaseModel):
28
+ """
29
+ Model for getting the results of a multi compare workflow.
30
+ """ # noqa: E501
31
+ page: Optional[PageInfo] = None
32
+ sort_criteria: Optional[List[SortCriterion]] = Field(default=None, description="A list of criteria to sort the results by.", alias="sortCriteria")
33
+ __properties: ClassVar[List[str]] = ["page", "sortCriteria"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of GetGroupedRankingWorkflowResultsModel from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of page
75
+ if self.page:
76
+ _dict['page'] = self.page.to_dict()
77
+ # override the default output from pydantic by calling `to_dict()` of each item in sort_criteria (list)
78
+ _items = []
79
+ if self.sort_criteria:
80
+ for _item_sort_criteria in self.sort_criteria:
81
+ if _item_sort_criteria:
82
+ _items.append(_item_sort_criteria.to_dict())
83
+ _dict['sortCriteria'] = _items
84
+ # set to None if sort_criteria (nullable) is None
85
+ # and model_fields_set contains the field
86
+ if self.sort_criteria is None and "sort_criteria" in self.model_fields_set:
87
+ _dict['sortCriteria'] = None
88
+
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of GetGroupedRankingWorkflowResultsModel from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "page": PageInfo.from_dict(obj["page"]) if obj.get("page") is not None else None,
102
+ "sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None
103
+ })
104
+ return _obj
105
+
106
+
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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 rapidata.api_client.models.compare_workflow_model1_pair_maker_information import CompareWorkflowModel1PairMakerInformation
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetGroupedRankingWorkflowResultsResult(BaseModel):
27
+ """
28
+ GetGroupedRankingWorkflowResultsResult
29
+ """ # noqa: E501
30
+ id: StrictStr
31
+ name: StrictStr
32
+ state: StrictStr
33
+ pair_maker_information: CompareWorkflowModel1PairMakerInformation = Field(alias="pairMakerInformation")
34
+ __properties: ClassVar[List[str]] = ["id", "name", "state", "pairMakerInformation"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of GetGroupedRankingWorkflowResultsResult from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of pair_maker_information
76
+ if self.pair_maker_information:
77
+ _dict['pairMakerInformation'] = self.pair_maker_information.to_dict()
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of GetGroupedRankingWorkflowResultsResult from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "id": obj.get("id"),
91
+ "name": obj.get("name"),
92
+ "state": obj.get("state"),
93
+ "pairMakerInformation": CompareWorkflowModel1PairMakerInformation.from_dict(obj["pairMakerInformation"]) if obj.get("pairMakerInformation") is not None else None
94
+ })
95
+ return _obj
96
+
97
+
@@ -0,0 +1,105 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.get_grouped_ranking_workflow_results_result import GetGroupedRankingWorkflowResultsResult
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetGroupedRankingWorkflowResultsResultPagedResult(BaseModel):
27
+ """
28
+ GetGroupedRankingWorkflowResultsResultPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[GetGroupedRankingWorkflowResultsResult]
34
+ total_pages: Optional[StrictInt] = Field(default=None, alias="totalPages")
35
+ __properties: ClassVar[List[str]] = ["total", "page", "pageSize", "items", "totalPages"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of GetGroupedRankingWorkflowResultsResultPagedResult from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ * OpenAPI `readOnly` fields are excluded.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "total_pages",
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
79
+ _items = []
80
+ if self.items:
81
+ for _item_items in self.items:
82
+ if _item_items:
83
+ _items.append(_item_items.to_dict())
84
+ _dict['items'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of GetGroupedRankingWorkflowResultsResultPagedResult from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "total": obj.get("total"),
98
+ "page": obj.get("page"),
99
+ "pageSize": obj.get("pageSize"),
100
+ "items": [GetGroupedRankingWorkflowResultsResult.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
101
+ "totalPages": obj.get("totalPages")
102
+ })
103
+ return _obj
104
+
105
+
@@ -19,12 +19,13 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, f
19
19
  from typing import Any, List, Optional
20
20
  from rapidata.api_client.models.compare_workflow_model1 import CompareWorkflowModel1
21
21
  from rapidata.api_client.models.evaluation_workflow_model1 import EvaluationWorkflowModel1
22
+ from rapidata.api_client.models.grouped_ranking_workflow_model1 import GroupedRankingWorkflowModel1
22
23
  from rapidata.api_client.models.simple_workflow_model1 import SimpleWorkflowModel1
23
24
  from pydantic import StrictStr, Field
24
25
  from typing import Union, List, Set, Optional, Dict
25
26
  from typing_extensions import Literal, Self
26
27
 
27
- GETWORKFLOWBYIDRESULTWORKFLOW_ONE_OF_SCHEMAS = ["CompareWorkflowModel1", "EvaluationWorkflowModel1", "SimpleWorkflowModel1"]
28
+ GETWORKFLOWBYIDRESULTWORKFLOW_ONE_OF_SCHEMAS = ["CompareWorkflowModel1", "EvaluationWorkflowModel1", "GroupedRankingWorkflowModel1", "SimpleWorkflowModel1"]
28
29
 
29
30
  class GetWorkflowByIdResultWorkflow(BaseModel):
30
31
  """
@@ -34,10 +35,12 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
34
35
  oneof_schema_1_validator: Optional[CompareWorkflowModel1] = None
35
36
  # data type: EvaluationWorkflowModel1
36
37
  oneof_schema_2_validator: Optional[EvaluationWorkflowModel1] = None
38
+ # data type: GroupedRankingWorkflowModel1
39
+ oneof_schema_3_validator: Optional[GroupedRankingWorkflowModel1] = None
37
40
  # data type: SimpleWorkflowModel1
38
- oneof_schema_3_validator: Optional[SimpleWorkflowModel1] = None
39
- actual_instance: Optional[Union[CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1]] = None
40
- one_of_schemas: Set[str] = { "CompareWorkflowModel1", "EvaluationWorkflowModel1", "SimpleWorkflowModel1" }
41
+ oneof_schema_4_validator: Optional[SimpleWorkflowModel1] = None
42
+ actual_instance: Optional[Union[CompareWorkflowModel1, EvaluationWorkflowModel1, GroupedRankingWorkflowModel1, SimpleWorkflowModel1]] = None
43
+ one_of_schemas: Set[str] = { "CompareWorkflowModel1", "EvaluationWorkflowModel1", "GroupedRankingWorkflowModel1", "SimpleWorkflowModel1" }
41
44
 
42
45
  model_config = ConfigDict(
43
46
  validate_assignment=True,
@@ -73,6 +76,11 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
73
76
  error_messages.append(f"Error! Input type `{type(v)}` is not `EvaluationWorkflowModel1`")
74
77
  else:
75
78
  match += 1
79
+ # validate data type: GroupedRankingWorkflowModel1
80
+ if not isinstance(v, GroupedRankingWorkflowModel1):
81
+ error_messages.append(f"Error! Input type `{type(v)}` is not `GroupedRankingWorkflowModel1`")
82
+ else:
83
+ match += 1
76
84
  # validate data type: SimpleWorkflowModel1
77
85
  if not isinstance(v, SimpleWorkflowModel1):
78
86
  error_messages.append(f"Error! Input type `{type(v)}` is not `SimpleWorkflowModel1`")
@@ -80,10 +88,10 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
80
88
  match += 1
81
89
  if match > 1:
82
90
  # more than 1 match
83
- raise ValueError("Multiple matches found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
91
+ raise ValueError("Multiple matches found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, GroupedRankingWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
84
92
  elif match == 0:
85
93
  # no match
86
- raise ValueError("No match found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
94
+ raise ValueError("No match found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, GroupedRankingWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
87
95
  else:
88
96
  return v
89
97
 
@@ -110,6 +118,12 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
110
118
  match += 1
111
119
  except (ValidationError, ValueError) as e:
112
120
  error_messages.append(str(e))
121
+ # deserialize data into GroupedRankingWorkflowModel1
122
+ try:
123
+ instance.actual_instance = GroupedRankingWorkflowModel1.from_json(json_str)
124
+ match += 1
125
+ except (ValidationError, ValueError) as e:
126
+ error_messages.append(str(e))
113
127
  # deserialize data into SimpleWorkflowModel1
114
128
  try:
115
129
  instance.actual_instance = SimpleWorkflowModel1.from_json(json_str)
@@ -119,10 +133,10 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
119
133
 
120
134
  if match > 1:
121
135
  # more than 1 match
122
- raise ValueError("Multiple matches found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
136
+ raise ValueError("Multiple matches found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, GroupedRankingWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
123
137
  elif match == 0:
124
138
  # no match
125
- raise ValueError("No match found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
139
+ raise ValueError("No match found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, GroupedRankingWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
126
140
  else:
127
141
  return instance
128
142
 
@@ -136,7 +150,7 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
136
150
  else:
137
151
  return json.dumps(self.actual_instance)
138
152
 
139
- def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1]]:
153
+ def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowModel1, EvaluationWorkflowModel1, GroupedRankingWorkflowModel1, SimpleWorkflowModel1]]:
140
154
  """Returns the dict representation of the actual instance"""
141
155
  if self.actual_instance is None:
142
156
  return None
@@ -0,0 +1,143 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.compare_workflow_config_pair_maker_config import CompareWorkflowConfigPairMakerConfig
23
+ from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
24
+ from rapidata.api_client.models.elo_config import EloConfig
25
+ from rapidata.api_client.models.feature_flag import FeatureFlag
26
+ from rapidata.api_client.models.file_asset_metadata_value import FileAssetMetadataValue
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+ class GroupedRankingWorkflowConfig(BaseModel):
31
+ """
32
+ GroupedRankingWorkflowConfig
33
+ """ # noqa: E501
34
+ t: StrictStr = Field(description="Discriminator value for GroupedRankingWorkflowConfig", alias="_t")
35
+ criteria: StrictStr
36
+ referee: CompareWorkflowModel1Referee
37
+ target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
38
+ metadata: Dict[str, FileAssetMetadataValue]
39
+ max_parallelism: StrictInt = Field(alias="maxParallelism")
40
+ elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
41
+ pair_maker_config: Optional[CompareWorkflowConfigPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
42
+ feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
43
+ __properties: ClassVar[List[str]] = ["_t", "criteria", "referee", "targetCountryCodes", "metadata", "maxParallelism", "eloConfig", "pairMakerConfig", "featureFlags"]
44
+
45
+ @field_validator('t')
46
+ def t_validate_enum(cls, value):
47
+ """Validates the enum"""
48
+ if value not in set(['GroupedRankingWorkflowConfig']):
49
+ raise ValueError("must be one of enum values ('GroupedRankingWorkflowConfig')")
50
+ return value
51
+
52
+ model_config = ConfigDict(
53
+ populate_by_name=True,
54
+ validate_assignment=True,
55
+ protected_namespaces=(),
56
+ )
57
+
58
+
59
+ def to_str(self) -> str:
60
+ """Returns the string representation of the model using alias"""
61
+ return pprint.pformat(self.model_dump(by_alias=True))
62
+
63
+ def to_json(self) -> str:
64
+ """Returns the JSON representation of the model using alias"""
65
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
66
+ return json.dumps(self.to_dict())
67
+
68
+ @classmethod
69
+ def from_json(cls, json_str: str) -> Optional[Self]:
70
+ """Create an instance of GroupedRankingWorkflowConfig from a JSON string"""
71
+ return cls.from_dict(json.loads(json_str))
72
+
73
+ def to_dict(self) -> Dict[str, Any]:
74
+ """Return the dictionary representation of the model using alias.
75
+
76
+ This has the following differences from calling pydantic's
77
+ `self.model_dump(by_alias=True)`:
78
+
79
+ * `None` is only added to the output dict for nullable fields that
80
+ were set at model initialization. Other fields with value `None`
81
+ are ignored.
82
+ """
83
+ excluded_fields: Set[str] = set([
84
+ ])
85
+
86
+ _dict = self.model_dump(
87
+ by_alias=True,
88
+ exclude=excluded_fields,
89
+ exclude_none=True,
90
+ )
91
+ # override the default output from pydantic by calling `to_dict()` of referee
92
+ if self.referee:
93
+ _dict['referee'] = self.referee.to_dict()
94
+ # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
95
+ _field_dict = {}
96
+ if self.metadata:
97
+ for _key_metadata in self.metadata:
98
+ if self.metadata[_key_metadata]:
99
+ _field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
100
+ _dict['metadata'] = _field_dict
101
+ # override the default output from pydantic by calling `to_dict()` of elo_config
102
+ if self.elo_config:
103
+ _dict['eloConfig'] = self.elo_config.to_dict()
104
+ # override the default output from pydantic by calling `to_dict()` of pair_maker_config
105
+ if self.pair_maker_config:
106
+ _dict['pairMakerConfig'] = self.pair_maker_config.to_dict()
107
+ # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
108
+ _items = []
109
+ if self.feature_flags:
110
+ for _item_feature_flags in self.feature_flags:
111
+ if _item_feature_flags:
112
+ _items.append(_item_feature_flags.to_dict())
113
+ _dict['featureFlags'] = _items
114
+ return _dict
115
+
116
+ @classmethod
117
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
118
+ """Create an instance of GroupedRankingWorkflowConfig from a dict"""
119
+ if obj is None:
120
+ return None
121
+
122
+ if not isinstance(obj, dict):
123
+ return cls.model_validate(obj)
124
+
125
+ _obj = cls.model_validate({
126
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'GroupedRankingWorkflowConfig',
127
+ "criteria": obj.get("criteria"),
128
+ "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
129
+ "targetCountryCodes": obj.get("targetCountryCodes"),
130
+ "metadata": dict(
131
+ (_k, FileAssetMetadataValue.from_dict(_v))
132
+ for _k, _v in obj["metadata"].items()
133
+ )
134
+ if obj.get("metadata") is not None
135
+ else None,
136
+ "maxParallelism": obj.get("maxParallelism"),
137
+ "eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
138
+ "pairMakerConfig": CompareWorkflowConfigPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
139
+ "featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
140
+ })
141
+ return _obj
142
+
143
+
@@ -0,0 +1,135 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.compare_workflow_model_pair_maker_config import CompareWorkflowModelPairMakerConfig
23
+ from rapidata.api_client.models.create_datapoint_from_files_model_metadata_inner import CreateDatapointFromFilesModelMetadataInner
24
+ from rapidata.api_client.models.elo_config_model import EloConfigModel
25
+ from rapidata.api_client.models.feature_flag import FeatureFlag
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class GroupedRankingWorkflowModel(BaseModel):
30
+ """
31
+ GroupedRankingWorkflowModel
32
+ """ # noqa: E501
33
+ t: StrictStr = Field(description="Discriminator value for GroupedRankingWorkflow", alias="_t")
34
+ criteria: StrictStr
35
+ pair_maker_config: Optional[CompareWorkflowModelPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
36
+ elo_config: Optional[EloConfigModel] = Field(default=None, alias="eloConfig")
37
+ metadata: Optional[List[CreateDatapointFromFilesModelMetadataInner]] = None
38
+ feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
39
+ max_parallelism: Optional[StrictInt] = Field(default=None, alias="maxParallelism")
40
+ __properties: ClassVar[List[str]] = ["_t", "criteria", "pairMakerConfig", "eloConfig", "metadata", "featureFlags", "maxParallelism"]
41
+
42
+ @field_validator('t')
43
+ def t_validate_enum(cls, value):
44
+ """Validates the enum"""
45
+ if value not in set(['GroupedRankingWorkflow']):
46
+ raise ValueError("must be one of enum values ('GroupedRankingWorkflow')")
47
+ return value
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+
56
+ def to_str(self) -> str:
57
+ """Returns the string representation of the model using alias"""
58
+ return pprint.pformat(self.model_dump(by_alias=True))
59
+
60
+ def to_json(self) -> str:
61
+ """Returns the JSON representation of the model using alias"""
62
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
+ return json.dumps(self.to_dict())
64
+
65
+ @classmethod
66
+ def from_json(cls, json_str: str) -> Optional[Self]:
67
+ """Create an instance of GroupedRankingWorkflowModel from a JSON string"""
68
+ return cls.from_dict(json.loads(json_str))
69
+
70
+ def to_dict(self) -> Dict[str, Any]:
71
+ """Return the dictionary representation of the model using alias.
72
+
73
+ This has the following differences from calling pydantic's
74
+ `self.model_dump(by_alias=True)`:
75
+
76
+ * `None` is only added to the output dict for nullable fields that
77
+ were set at model initialization. Other fields with value `None`
78
+ are ignored.
79
+ """
80
+ excluded_fields: Set[str] = set([
81
+ ])
82
+
83
+ _dict = self.model_dump(
84
+ by_alias=True,
85
+ exclude=excluded_fields,
86
+ exclude_none=True,
87
+ )
88
+ # override the default output from pydantic by calling `to_dict()` of pair_maker_config
89
+ if self.pair_maker_config:
90
+ _dict['pairMakerConfig'] = self.pair_maker_config.to_dict()
91
+ # override the default output from pydantic by calling `to_dict()` of elo_config
92
+ if self.elo_config:
93
+ _dict['eloConfig'] = self.elo_config.to_dict()
94
+ # override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
95
+ _items = []
96
+ if self.metadata:
97
+ for _item_metadata in self.metadata:
98
+ if _item_metadata:
99
+ _items.append(_item_metadata.to_dict())
100
+ _dict['metadata'] = _items
101
+ # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
102
+ _items = []
103
+ if self.feature_flags:
104
+ for _item_feature_flags in self.feature_flags:
105
+ if _item_feature_flags:
106
+ _items.append(_item_feature_flags.to_dict())
107
+ _dict['featureFlags'] = _items
108
+ # set to None if metadata (nullable) is None
109
+ # and model_fields_set contains the field
110
+ if self.metadata is None and "metadata" in self.model_fields_set:
111
+ _dict['metadata'] = None
112
+
113
+ return _dict
114
+
115
+ @classmethod
116
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
117
+ """Create an instance of GroupedRankingWorkflowModel from a dict"""
118
+ if obj is None:
119
+ return None
120
+
121
+ if not isinstance(obj, dict):
122
+ return cls.model_validate(obj)
123
+
124
+ _obj = cls.model_validate({
125
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'GroupedRankingWorkflow',
126
+ "criteria": obj.get("criteria"),
127
+ "pairMakerConfig": CompareWorkflowModelPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
128
+ "eloConfig": EloConfigModel.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
129
+ "metadata": [CreateDatapointFromFilesModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
130
+ "featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
131
+ "maxParallelism": obj.get("maxParallelism")
132
+ })
133
+ return _obj
134
+
135
+