arize 8.0.0a12__py3-none-any.whl → 8.0.0a13__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 (33) hide show
  1. arize/_flight/client.py +79 -3
  2. arize/_generated/api_client/__init__.py +1 -43
  3. arize/_generated/api_client/api/__init__.py +1 -17
  4. arize/_generated/api_client/api/datasets_api.py +10 -11
  5. arize/_generated/api_client/api/experiments_api.py +276 -0
  6. arize/_generated/api_client/api_client.py +4 -4
  7. arize/_generated/api_client/models/__init__.py +1 -26
  8. arize/_generated/api_client/models/dataset.py +5 -13
  9. arize/_generated/api_client/models/dataset_version.py +5 -13
  10. arize/_generated/api_client/models/datasets_create_request.py +5 -13
  11. arize/_generated/api_client/models/datasets_list200_response.py +5 -0
  12. arize/_generated/api_client/models/datasets_list_examples200_response.py +8 -3
  13. arize/_generated/api_client/models/error.py +5 -13
  14. arize/_generated/api_client/models/experiment.py +5 -13
  15. arize/_generated/api_client/models/experiments_list200_response.py +14 -9
  16. arize/_generated/api_client/test/test_datasets_list_examples200_response.py +2 -2
  17. arize/_generated/api_client/test/test_experiments_api.py +7 -0
  18. arize/_generated/api_client/test/test_experiments_list200_response.py +2 -2
  19. arize/_generated/api_client_README.md +2 -2
  20. arize/_generated/protocol/flight/export_pb2.py +8 -8
  21. arize/_lazy.py +4 -0
  22. arize/client.py +17 -4
  23. arize/config.py +13 -3
  24. arize/datasets/__init__.py +70 -0
  25. arize/datasets/client.py +119 -1
  26. arize/utils/proto.py +0 -36
  27. arize/version.py +1 -1
  28. {arize-8.0.0a12.dist-info → arize-8.0.0a13.dist-info}/METADATA +90 -1
  29. {arize-8.0.0a12.dist-info → arize-8.0.0a13.dist-info}/RECORD +31 -33
  30. arize/_generated/api_client/models/datasets_create201_response.py +0 -87
  31. arize/_generated/api_client/test/test_datasets_create201_response.py +0 -52
  32. {arize-8.0.0a12.dist-info → arize-8.0.0a13.dist-info}/WHEEL +0 -0
  33. {arize-8.0.0a12.dist-info → arize-8.0.0a13.dist-info}/licenses/LICENSE.md +0 -0
@@ -34,7 +34,6 @@ class Dataset(BaseModel):
34
34
  created_at: Optional[datetime] = Field(default=None, description="Timestamp for when the dataset was created", alias="createdAt")
35
35
  updated_at: Optional[datetime] = Field(default=None, description="Timestamp for the last update of the dataset", alias="updatedAt")
36
36
  versions: Optional[List[DatasetVersion]] = Field(default=None, description="List of versions associated with this dataset")
37
- additional_properties: Dict[str, Any] = {}
38
37
  __properties: ClassVar[List[str]] = ["id", "name", "spaceId", "createdAt", "updatedAt", "versions"]
39
38
 
40
39
  model_config = ConfigDict(
@@ -67,10 +66,8 @@ class Dataset(BaseModel):
67
66
  * `None` is only added to the output dict for nullable fields that
68
67
  were set at model initialization. Other fields with value `None`
69
68
  are ignored.
70
- * Fields in `self.additional_properties` are added to the output dict.
71
69
  """
72
70
  excluded_fields: Set[str] = set([
73
- "additional_properties",
74
71
  ])
75
72
 
76
73
  _dict = self.model_dump(
@@ -85,11 +82,6 @@ class Dataset(BaseModel):
85
82
  if _item_versions:
86
83
  _items.append(_item_versions.to_dict())
87
84
  _dict['versions'] = _items
88
- # puts key-value pairs in additional_properties in the top level
89
- if self.additional_properties is not None:
90
- for _key, _value in self.additional_properties.items():
91
- _dict[_key] = _value
92
-
93
85
  return _dict
94
86
 
95
87
  @classmethod
@@ -101,6 +93,11 @@ class Dataset(BaseModel):
101
93
  if not isinstance(obj, dict):
102
94
  return cls.model_validate(obj)
103
95
 
96
+ # raise errors for additional fields in the input
97
+ for _key in obj.keys():
98
+ if _key not in cls.__properties:
99
+ raise ValueError("Error due to additional fields (not defined in Dataset) in the input: " + _key)
100
+
104
101
  _obj = cls.model_validate({
105
102
  "id": obj.get("id"),
106
103
  "name": obj.get("name"),
@@ -109,11 +106,6 @@ class Dataset(BaseModel):
109
106
  "updatedAt": obj.get("updatedAt"),
110
107
  "versions": [DatasetVersion.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None
111
108
  })
112
- # store additional fields in additional_properties
113
- for _key in obj.keys():
114
- if _key not in cls.__properties:
115
- _obj.additional_properties[_key] = obj.get(_key)
116
-
117
109
  return _obj
118
110
 
119
111
 
@@ -32,7 +32,6 @@ class DatasetVersion(BaseModel):
32
32
  dataset_id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the dataset this version belongs to", alias="datasetId")
33
33
  created_at: Optional[datetime] = Field(default=None, description="Timestamp for when the dataset version was created", alias="createdAt")
34
34
  updated_at: Optional[datetime] = Field(default=None, description="Timestamp for the last update of the dataset version", alias="updatedAt")
35
- additional_properties: Dict[str, Any] = {}
36
35
  __properties: ClassVar[List[str]] = ["id", "name", "datasetId", "createdAt", "updatedAt"]
37
36
 
38
37
  model_config = ConfigDict(
@@ -65,10 +64,8 @@ class DatasetVersion(BaseModel):
65
64
  * `None` is only added to the output dict for nullable fields that
66
65
  were set at model initialization. Other fields with value `None`
67
66
  are ignored.
68
- * Fields in `self.additional_properties` are added to the output dict.
69
67
  """
70
68
  excluded_fields: Set[str] = set([
71
- "additional_properties",
72
69
  ])
73
70
 
74
71
  _dict = self.model_dump(
@@ -76,11 +73,6 @@ class DatasetVersion(BaseModel):
76
73
  exclude=excluded_fields,
77
74
  exclude_none=True,
78
75
  )
79
- # puts key-value pairs in additional_properties in the top level
80
- if self.additional_properties is not None:
81
- for _key, _value in self.additional_properties.items():
82
- _dict[_key] = _value
83
-
84
76
  return _dict
85
77
 
86
78
  @classmethod
@@ -92,6 +84,11 @@ class DatasetVersion(BaseModel):
92
84
  if not isinstance(obj, dict):
93
85
  return cls.model_validate(obj)
94
86
 
87
+ # raise errors for additional fields in the input
88
+ for _key in obj.keys():
89
+ if _key not in cls.__properties:
90
+ raise ValueError("Error due to additional fields (not defined in DatasetVersion) in the input: " + _key)
91
+
95
92
  _obj = cls.model_validate({
96
93
  "id": obj.get("id"),
97
94
  "name": obj.get("name"),
@@ -99,11 +96,6 @@ class DatasetVersion(BaseModel):
99
96
  "createdAt": obj.get("createdAt"),
100
97
  "updatedAt": obj.get("updatedAt")
101
98
  })
102
- # store additional fields in additional_properties
103
- for _key in obj.keys():
104
- if _key not in cls.__properties:
105
- _obj.additional_properties[_key] = obj.get(_key)
106
-
107
99
  return _obj
108
100
 
109
101
 
@@ -29,7 +29,6 @@ class DatasetsCreateRequest(BaseModel):
29
29
  name: StrictStr
30
30
  space_id: Optional[StrictStr] = Field(default=None, alias="spaceId")
31
31
  examples: List[Dict[str, Any]]
32
- additional_properties: Dict[str, Any] = {}
33
32
  __properties: ClassVar[List[str]] = ["name", "spaceId", "examples"]
34
33
 
35
34
  model_config = ConfigDict(
@@ -62,10 +61,8 @@ class DatasetsCreateRequest(BaseModel):
62
61
  * `None` is only added to the output dict for nullable fields that
63
62
  were set at model initialization. Other fields with value `None`
64
63
  are ignored.
65
- * Fields in `self.additional_properties` are added to the output dict.
66
64
  """
67
65
  excluded_fields: Set[str] = set([
68
- "additional_properties",
69
66
  ])
70
67
 
71
68
  _dict = self.model_dump(
@@ -73,11 +70,6 @@ class DatasetsCreateRequest(BaseModel):
73
70
  exclude=excluded_fields,
74
71
  exclude_none=True,
75
72
  )
76
- # puts key-value pairs in additional_properties in the top level
77
- if self.additional_properties is not None:
78
- for _key, _value in self.additional_properties.items():
79
- _dict[_key] = _value
80
-
81
73
  return _dict
82
74
 
83
75
  @classmethod
@@ -89,16 +81,16 @@ class DatasetsCreateRequest(BaseModel):
89
81
  if not isinstance(obj, dict):
90
82
  return cls.model_validate(obj)
91
83
 
84
+ # raise errors for additional fields in the input
85
+ for _key in obj.keys():
86
+ if _key not in cls.__properties:
87
+ raise ValueError("Error due to additional fields (not defined in DatasetsCreateRequest) in the input: " + _key)
88
+
92
89
  _obj = cls.model_validate({
93
90
  "name": obj.get("name"),
94
91
  "spaceId": obj.get("spaceId"),
95
92
  "examples": obj.get("examples")
96
93
  })
97
- # store additional fields in additional_properties
98
- for _key in obj.keys():
99
- if _key not in cls.__properties:
100
- _obj.additional_properties[_key] = obj.get(_key)
101
-
102
94
  return _obj
103
95
 
104
96
 
@@ -87,6 +87,11 @@ class DatasetsList200Response(BaseModel):
87
87
  if not isinstance(obj, dict):
88
88
  return cls.model_validate(obj)
89
89
 
90
+ # raise errors for additional fields in the input
91
+ for _key in obj.keys():
92
+ if _key not in cls.__properties:
93
+ raise ValueError("Error due to additional fields (not defined in DatasetsList200Response) in the input: " + _key)
94
+
90
95
  _obj = cls.model_validate({
91
96
  "datasets": [Dataset.from_dict(_item) for _item in obj["datasets"]] if obj.get("datasets") is not None else None
92
97
  })
@@ -26,8 +26,8 @@ class DatasetsListExamples200Response(BaseModel):
26
26
  """
27
27
  DatasetsListExamples200Response
28
28
  """ # noqa: E501
29
- data: List[Dict[str, Any]] = Field(description="Array of example objects from the dataset")
30
- __properties: ClassVar[List[str]] = ["data"]
29
+ examples: List[Dict[str, Any]] = Field(description="Array of example objects from the dataset")
30
+ __properties: ClassVar[List[str]] = ["examples"]
31
31
 
32
32
  model_config = ConfigDict(
33
33
  populate_by_name=True,
@@ -79,8 +79,13 @@ class DatasetsListExamples200Response(BaseModel):
79
79
  if not isinstance(obj, dict):
80
80
  return cls.model_validate(obj)
81
81
 
82
+ # raise errors for additional fields in the input
83
+ for _key in obj.keys():
84
+ if _key not in cls.__properties:
85
+ raise ValueError("Error due to additional fields (not defined in DatasetsListExamples200Response) in the input: " + _key)
86
+
82
87
  _obj = cls.model_validate({
83
- "data": obj.get("data")
88
+ "examples": obj.get("examples")
84
89
  })
85
90
  return _obj
86
91
 
@@ -27,7 +27,6 @@ class Error(BaseModel):
27
27
  Error
28
28
  """ # noqa: E501
29
29
  message: Optional[StrictStr] = None
30
- additional_properties: Dict[str, Any] = {}
31
30
  __properties: ClassVar[List[str]] = ["message"]
32
31
 
33
32
  model_config = ConfigDict(
@@ -60,10 +59,8 @@ class Error(BaseModel):
60
59
  * `None` is only added to the output dict for nullable fields that
61
60
  were set at model initialization. Other fields with value `None`
62
61
  are ignored.
63
- * Fields in `self.additional_properties` are added to the output dict.
64
62
  """
65
63
  excluded_fields: Set[str] = set([
66
- "additional_properties",
67
64
  ])
68
65
 
69
66
  _dict = self.model_dump(
@@ -71,11 +68,6 @@ class Error(BaseModel):
71
68
  exclude=excluded_fields,
72
69
  exclude_none=True,
73
70
  )
74
- # puts key-value pairs in additional_properties in the top level
75
- if self.additional_properties is not None:
76
- for _key, _value in self.additional_properties.items():
77
- _dict[_key] = _value
78
-
79
71
  return _dict
80
72
 
81
73
  @classmethod
@@ -87,14 +79,14 @@ class Error(BaseModel):
87
79
  if not isinstance(obj, dict):
88
80
  return cls.model_validate(obj)
89
81
 
90
- _obj = cls.model_validate({
91
- "message": obj.get("message")
92
- })
93
- # store additional fields in additional_properties
82
+ # raise errors for additional fields in the input
94
83
  for _key in obj.keys():
95
84
  if _key not in cls.__properties:
96
- _obj.additional_properties[_key] = obj.get(_key)
85
+ raise ValueError("Error due to additional fields (not defined in Error) in the input: " + _key)
97
86
 
87
+ _obj = cls.model_validate({
88
+ "message": obj.get("message")
89
+ })
98
90
  return _obj
99
91
 
100
92
 
@@ -35,7 +35,6 @@ class Experiment(BaseModel):
35
35
  updated_at: Optional[datetime] = Field(default=None, description="Timestamp for the last update of the experiment", alias="updatedAt")
36
36
  created_by: Optional[StrictStr] = Field(default=None, description="Unique identifier for the user who created the experiment", alias="createdBy")
37
37
  experiment_traces_project_id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the experiment traces project this experiment belongs to (if it exists)", alias="experimentTracesProjectId")
38
- additional_properties: Dict[str, Any] = {}
39
38
  __properties: ClassVar[List[str]] = ["id", "name", "datasetId", "datasetVersionId", "createdAt", "updatedAt", "createdBy", "experimentTracesProjectId"]
40
39
 
41
40
  model_config = ConfigDict(
@@ -68,10 +67,8 @@ class Experiment(BaseModel):
68
67
  * `None` is only added to the output dict for nullable fields that
69
68
  were set at model initialization. Other fields with value `None`
70
69
  are ignored.
71
- * Fields in `self.additional_properties` are added to the output dict.
72
70
  """
73
71
  excluded_fields: Set[str] = set([
74
- "additional_properties",
75
72
  ])
76
73
 
77
74
  _dict = self.model_dump(
@@ -79,11 +76,6 @@ class Experiment(BaseModel):
79
76
  exclude=excluded_fields,
80
77
  exclude_none=True,
81
78
  )
82
- # puts key-value pairs in additional_properties in the top level
83
- if self.additional_properties is not None:
84
- for _key, _value in self.additional_properties.items():
85
- _dict[_key] = _value
86
-
87
79
  return _dict
88
80
 
89
81
  @classmethod
@@ -95,6 +87,11 @@ class Experiment(BaseModel):
95
87
  if not isinstance(obj, dict):
96
88
  return cls.model_validate(obj)
97
89
 
90
+ # raise errors for additional fields in the input
91
+ for _key in obj.keys():
92
+ if _key not in cls.__properties:
93
+ raise ValueError("Error due to additional fields (not defined in Experiment) in the input: " + _key)
94
+
98
95
  _obj = cls.model_validate({
99
96
  "id": obj.get("id"),
100
97
  "name": obj.get("name"),
@@ -105,11 +102,6 @@ class Experiment(BaseModel):
105
102
  "createdBy": obj.get("createdBy"),
106
103
  "experimentTracesProjectId": obj.get("experimentTracesProjectId")
107
104
  })
108
- # store additional fields in additional_properties
109
- for _key in obj.keys():
110
- if _key not in cls.__properties:
111
- _obj.additional_properties[_key] = obj.get(_key)
112
-
113
105
  return _obj
114
106
 
115
107
 
@@ -27,8 +27,8 @@ class ExperimentsList200Response(BaseModel):
27
27
  """
28
28
  ExperimentsList200Response
29
29
  """ # noqa: E501
30
- data: List[Experiment] = Field(description="A list of experiments")
31
- __properties: ClassVar[List[str]] = ["data"]
30
+ experiments: List[Experiment] = Field(description="A list of experiments")
31
+ __properties: ClassVar[List[str]] = ["experiments"]
32
32
 
33
33
  model_config = ConfigDict(
34
34
  populate_by_name=True,
@@ -69,13 +69,13 @@ class ExperimentsList200Response(BaseModel):
69
69
  exclude=excluded_fields,
70
70
  exclude_none=True,
71
71
  )
72
- # override the default output from pydantic by calling `to_dict()` of each item in data (list)
72
+ # override the default output from pydantic by calling `to_dict()` of each item in experiments (list)
73
73
  _items = []
74
- if self.data:
75
- for _item_data in self.data:
76
- if _item_data:
77
- _items.append(_item_data.to_dict())
78
- _dict['data'] = _items
74
+ if self.experiments:
75
+ for _item_experiments in self.experiments:
76
+ if _item_experiments:
77
+ _items.append(_item_experiments.to_dict())
78
+ _dict['experiments'] = _items
79
79
  return _dict
80
80
 
81
81
  @classmethod
@@ -87,8 +87,13 @@ class ExperimentsList200Response(BaseModel):
87
87
  if not isinstance(obj, dict):
88
88
  return cls.model_validate(obj)
89
89
 
90
+ # raise errors for additional fields in the input
91
+ for _key in obj.keys():
92
+ if _key not in cls.__properties:
93
+ raise ValueError("Error due to additional fields (not defined in ExperimentsList200Response) in the input: " + _key)
94
+
90
95
  _obj = cls.model_validate({
91
- "data": [Experiment.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
96
+ "experiments": [Experiment.from_dict(_item) for _item in obj["experiments"]] if obj.get("experiments") is not None else None
92
97
  })
93
98
  return _obj
94
99
 
@@ -35,13 +35,13 @@ class TestDatasetsListExamples200Response(unittest.TestCase):
35
35
  model = DatasetsListExamples200Response()
36
36
  if include_optional:
37
37
  return DatasetsListExamples200Response(
38
- data = [
38
+ examples = [
39
39
  None
40
40
  ]
41
41
  )
42
42
  else:
43
43
  return DatasetsListExamples200Response(
44
- data = [
44
+ examples = [
45
45
  None
46
46
  ],
47
47
  )
@@ -26,6 +26,13 @@ class TestExperimentsApi(unittest.TestCase):
26
26
  def tearDown(self) -> None:
27
27
  pass
28
28
 
29
+ def test_experiments_delete(self) -> None:
30
+ """Test case for experiments_delete
31
+
32
+ Delete an experiment by ID
33
+ """
34
+ pass
35
+
29
36
  def test_experiments_list(self) -> None:
30
37
  """Test case for experiments_list
31
38
 
@@ -35,7 +35,7 @@ class TestExperimentsList200Response(unittest.TestCase):
35
35
  model = ExperimentsList200Response()
36
36
  if include_optional:
37
37
  return ExperimentsList200Response(
38
- data = [
38
+ experiments = [
39
39
  arize._generated.api_client.models.experiment.Experiment(
40
40
  id = '',
41
41
  name = '',
@@ -49,7 +49,7 @@ class TestExperimentsList200Response(unittest.TestCase):
49
49
  )
50
50
  else:
51
51
  return ExperimentsList200Response(
52
- data = [
52
+ experiments = [
53
53
  arize._generated.api_client.models.experiment.Experiment(
54
54
  id = '',
55
55
  name = '',
@@ -5,7 +5,7 @@ The `arize._generated.api_client` package is automatically generated by the [Ope
5
5
 
6
6
  - API version: 0.0.1
7
7
  - Package version: 1.0.0
8
- - Generator version: 7.15.0
8
+ - Generator version: 7.16.0
9
9
  - Build package: org.openapitools.codegen.languages.PythonClientCodegen
10
10
 
11
11
  ## Requirements.
@@ -79,6 +79,7 @@ Class | Method | HTTP request | Description
79
79
  *DatasetsApi* | [**datasets_get**](arize/_generated/api_client/docs/DatasetsApi.md#datasets_get) | **GET** /api/v1/datasets/{datasetId} | Get dataset by ID
80
80
  *DatasetsApi* | [**datasets_list**](arize/_generated/api_client/docs/DatasetsApi.md#datasets_list) | **GET** /api/v1/datasets | List datasets the user has access to
81
81
  *DatasetsApi* | [**datasets_list_examples**](arize/_generated/api_client/docs/DatasetsApi.md#datasets_list_examples) | **GET** /api/v1/datasets/{datasetId}/examples | List examples for a dataset
82
+ *ExperimentsApi* | [**experiments_delete**](arize/_generated/api_client/docs/ExperimentsApi.md#experiments_delete) | **DELETE** /api/v1/experiments/{experimentId} | Delete an experiment by ID
82
83
  *ExperimentsApi* | [**experiments_list**](arize/_generated/api_client/docs/ExperimentsApi.md#experiments_list) | **GET** /api/v1/datasets/{datasetId}/experiments | List experiments for a given dataset
83
84
 
84
85
 
@@ -86,7 +87,6 @@ Class | Method | HTTP request | Description
86
87
 
87
88
  - [Dataset](arize/_generated/api_client/docs/Dataset.md)
88
89
  - [DatasetVersion](arize/_generated/api_client/docs/DatasetVersion.md)
89
- - [DatasetsCreate201Response](arize/_generated/api_client/docs/DatasetsCreate201Response.md)
90
90
  - [DatasetsCreateRequest](arize/_generated/api_client/docs/DatasetsCreateRequest.md)
91
91
  - [DatasetsList200Response](arize/_generated/api_client/docs/DatasetsList200Response.md)
92
92
  - [DatasetsListExamples200Response](arize/_generated/api_client/docs/DatasetsListExamples200Response.md)
@@ -16,7 +16,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__
16
16
  from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2
17
17
 
18
18
 
19
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x65xport.proto\x12\x06public\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xa2\x04\n\x15RecordQueryDescriptor\x12\x10\n\x08space_id\x18\x01 \x01(\t\x12\x10\n\x08model_id\x18\x02 \x01(\t\x12>\n\x0b\x65nvironment\x18\x03 \x01(\x0e\x32).public.RecordQueryDescriptor.Environment\x12\x15\n\rmodel_version\x18\x04 \x01(\t\x12\x10\n\x08\x62\x61tch_id\x18\x05 \x01(\t\x12.\n\nstart_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0finclude_actuals\x18\x08 \x01(\x08\x12\x19\n\x11\x66ilter_expression\x18\t \x01(\t\x12@\n\x18similarity_search_params\x18\n \x01(\x0b\x32\x1e.public.SimilaritySearchParams\x12\x19\n\x11projected_columns\x18\x0b \x03(\t\x12\x36\n\x11stream_chunk_size\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"U\n\x0b\x45nvironment\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08TRAINING\x10\x01\x12\x0e\n\nVALIDATION\x10\x02\x12\x0e\n\nPRODUCTION\x10\x03\x12\x0b\n\x07TRACING\x10\x04\"\x93\x02\n\x16SimilaritySearchParams\x12<\n\nreferences\x18\x01 \x03(\x0b\x32(.public.SimilaritySearchParams.Reference\x12\x1a\n\x12search_column_name\x18\x02 \x01(\t\x12\x11\n\tthreshold\x18\x03 \x01(\x01\x1a\x8b\x01\n\tReference\x12\x15\n\rprediction_id\x18\x01 \x01(\t\x12\x1d\n\x15reference_column_name\x18\x02 \x01(\t\x12\x38\n\x14prediction_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06vector\x18\x04 \x03(\x01\x42?Z=github.com/Arize-ai/arize/go/pkg/flightserver/protocol/publicb\x06proto3')
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x65xport.proto\x12\x06public\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xdb\x04\n\x15RecordQueryDescriptor\x12\x10\n\x08space_id\x18\x01 \x01(\t\x12\x10\n\x08model_id\x18\x02 \x01(\t\x12>\n\x0b\x65nvironment\x18\x03 \x01(\x0e\x32).public.RecordQueryDescriptor.Environment\x12\x15\n\rmodel_version\x18\x04 \x01(\t\x12\x10\n\x08\x62\x61tch_id\x18\x05 \x01(\t\x12.\n\nstart_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0finclude_actuals\x18\x08 \x01(\x08\x12\x19\n\x11\x66ilter_expression\x18\t \x01(\t\x12@\n\x18similarity_search_params\x18\n \x01(\x0b\x32\x1e.public.SimilaritySearchParams\x12\x19\n\x11projected_columns\x18\x0b \x03(\t\x12\x36\n\x11stream_chunk_size\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x37\n\x13parallelize_exports\x18\r \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"U\n\x0b\x45nvironment\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08TRAINING\x10\x01\x12\x0e\n\nVALIDATION\x10\x02\x12\x0e\n\nPRODUCTION\x10\x03\x12\x0b\n\x07TRACING\x10\x04\"\x93\x02\n\x16SimilaritySearchParams\x12<\n\nreferences\x18\x01 \x03(\x0b\x32(.public.SimilaritySearchParams.Reference\x12\x1a\n\x12search_column_name\x18\x02 \x01(\t\x12\x11\n\tthreshold\x18\x03 \x01(\x01\x1a\x8b\x01\n\tReference\x12\x15\n\rprediction_id\x18\x01 \x01(\t\x12\x1d\n\x15reference_column_name\x18\x02 \x01(\t\x12\x38\n\x14prediction_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06vector\x18\x04 \x03(\x01\x42?Z=github.com/Arize-ai/arize/go/pkg/flightserver/protocol/publicb\x06proto3')
20
20
 
21
21
 
22
22
 
@@ -51,11 +51,11 @@ if _descriptor._USE_C_DESCRIPTORS == False:
51
51
  DESCRIPTOR._options = None
52
52
  DESCRIPTOR._serialized_options = b'Z=github.com/Arize-ai/arize/go/pkg/flightserver/protocol/public'
53
53
  _RECORDQUERYDESCRIPTOR._serialized_start=90
54
- _RECORDQUERYDESCRIPTOR._serialized_end=636
55
- _RECORDQUERYDESCRIPTOR_ENVIRONMENT._serialized_start=551
56
- _RECORDQUERYDESCRIPTOR_ENVIRONMENT._serialized_end=636
57
- _SIMILARITYSEARCHPARAMS._serialized_start=639
58
- _SIMILARITYSEARCHPARAMS._serialized_end=914
59
- _SIMILARITYSEARCHPARAMS_REFERENCE._serialized_start=775
60
- _SIMILARITYSEARCHPARAMS_REFERENCE._serialized_end=914
54
+ _RECORDQUERYDESCRIPTOR._serialized_end=693
55
+ _RECORDQUERYDESCRIPTOR_ENVIRONMENT._serialized_start=608
56
+ _RECORDQUERYDESCRIPTOR_ENVIRONMENT._serialized_end=693
57
+ _SIMILARITYSEARCHPARAMS._serialized_start=696
58
+ _SIMILARITYSEARCHPARAMS._serialized_end=971
59
+ _SIMILARITYSEARCHPARAMS_REFERENCE._serialized_start=832
60
+ _SIMILARITYSEARCHPARAMS_REFERENCE._serialized_end=971
61
61
  # @@protoc_insertion_point(module_scope)
arize/_lazy.py CHANGED
@@ -1,6 +1,7 @@
1
1
  # src/arize/_lazy.py
2
2
  from __future__ import annotations
3
3
 
4
+ import logging
4
5
  import sys
5
6
  import threading
6
7
  from importlib import import_module
@@ -9,6 +10,8 @@ from typing import TYPE_CHECKING, Any, Dict, Tuple
9
10
  if TYPE_CHECKING:
10
11
  from arize.config import SDKConfiguration
11
12
 
13
+ logger = logging.getLogger(__name__)
14
+
12
15
 
13
16
  class LazySubclientsMixin:
14
17
  _SUBCLIENTS: Dict[str, Tuple[str, str]] = {}
@@ -30,6 +33,7 @@ class LazySubclientsMixin:
30
33
  if name in self._lazy_cache:
31
34
  return self._lazy_cache[name]
32
35
 
36
+ logger.debug(f"Lazily loading subclient {name!r}")
33
37
  module_path, class_name = subs[name]
34
38
  extra_key, required = self._EXTRAS.get(name, (None, ()))
35
39
  require(extra_key, required)
arize/client.py CHANGED
@@ -12,6 +12,7 @@ if TYPE_CHECKING:
12
12
  from arize.spans.client import SpansClient
13
13
 
14
14
 
15
+ # TODO(Kiko): Add flight max_chunksize opt to write_table. In config?
15
16
  # TODO(Kiko): experimental/datasets must be adapted into the datasets subclient
16
17
  # TODO(Kiko): experimental/prompt hub is missing
17
18
  # TODO(Kiko): exporter/utils/schema_parser is missing
@@ -43,10 +44,22 @@ class ArizeClient(LazySubclientsMixin):
43
44
  """
44
45
 
45
46
  _SUBCLIENTS = {
46
- "datasets": ("arize.datasets.client", "DatasetsClient"),
47
- "experiments": ("arize.experiments.client", "ExperimentsClient"),
48
- "spans": ("arize.spans.client", "SpansClient"),
49
- "models": ("arize.models.client", "MLModelsClient"),
47
+ "datasets": (
48
+ "arize.datasets.client",
49
+ "DatasetsClient",
50
+ ),
51
+ "experiments": (
52
+ "arize.experiments.client",
53
+ "ExperimentsClient",
54
+ ),
55
+ "spans": (
56
+ "arize.spans.client",
57
+ "SpansClient",
58
+ ),
59
+ "models": (
60
+ "arize.models.client",
61
+ "MLModelsClient",
62
+ ),
50
63
  }
51
64
  _EXTRAS = {
52
65
  # Gate only the generated-backed ones
arize/config.py CHANGED
@@ -1,3 +1,4 @@
1
+ import logging
1
2
  import os
2
3
  import sys
3
4
  import threading
@@ -26,6 +27,8 @@ from arize.constants.config import (
26
27
  from arize.exceptions.auth import MissingAPIKeyError
27
28
  from arize.version import __version__
28
29
 
30
+ logger = logging.getLogger(__name__)
31
+
29
32
 
30
33
  def _parse_bool(val: bool | str | None) -> bool:
31
34
  if isinstance(val, bool):
@@ -81,8 +84,11 @@ def _mask_secret(secret: str, N: int = 4) -> str:
81
84
  return f"{secret[:N]}***"
82
85
 
83
86
 
84
- def _endpoint(scheme: str, base: str, path: str) -> str:
85
- return scheme + "://" + base.rstrip("/") + "/" + path.lstrip("/")
87
+ def _endpoint(scheme: str, base: str, path: str = "") -> str:
88
+ endpoint = scheme + "://" + base.rstrip("/")
89
+ if path:
90
+ endpoint += "/" + path.lstrip("/")
91
+ return endpoint
86
92
 
87
93
 
88
94
  @dataclass(frozen=True)
@@ -111,6 +117,10 @@ class SDKConfiguration:
111
117
  if not self.api_key:
112
118
  raise MissingAPIKeyError()
113
119
 
120
+ @property
121
+ def api_url(self) -> str:
122
+ return _endpoint(self.api_scheme, self.api_host)
123
+
114
124
  @property
115
125
  def files_url(self) -> str:
116
126
  return _endpoint(self.api_scheme, self.api_host, "/v1/pandas_arrow")
@@ -170,7 +180,7 @@ class SDKConfiguration:
170
180
  # Import lazily so extras can be enforced outside
171
181
  from arize._generated import api_client as gen
172
182
 
173
- cfg = gen.Configuration(host=self.api_host)
183
+ cfg = gen.Configuration(host=self.api_url)
174
184
  if self.api_key:
175
185
  cfg.api_key["ApiKeyAuth"] = self.api_key
176
186
  client = gen.ApiClient(cfg)
@@ -0,0 +1,70 @@
1
+ from collections.abc import Mapping
2
+
3
+ from arize._generated.api_client import models
4
+
5
+
6
+ def make_to_df(field_name: str):
7
+ def to_df(
8
+ self,
9
+ by_alias: bool = False,
10
+ exclude_none: str | bool = False,
11
+ json_normalize: bool = False,
12
+ convert_dtypes: bool = True,
13
+ ):
14
+ """
15
+ Convert a list of objects to a pandas DataFrame.
16
+
17
+ Behavior:
18
+ - If an item is a Pydantic v2 model, use `.model_dump(by_alias=...)`.
19
+ - If an item is a mapping (dict-like), use it as-is.
20
+ - Otherwise, raise a ValueError (unsupported row type).
21
+
22
+ Parameters:
23
+ by_alias: Use field aliases when dumping Pydantic models.
24
+ exclude_none:
25
+ - False: keep Nones as-is
26
+ - "all": drop columns where *all* values are None/NaN
27
+ - "any": drop columns where *any* value is None/NaN
28
+ - True: alias for "all"
29
+ json_normalize: If True, flatten nested dicts via `pandas.json_normalize`.
30
+ convert_dtypes: If True, call `DataFrame.convert_dtypes()` at the end.
31
+
32
+ Returns:
33
+ pandas.DataFrame
34
+ """
35
+ import pandas as pd
36
+
37
+ items = getattr(self, field_name, []) or []
38
+
39
+ rows = []
40
+ for it in items:
41
+ if hasattr(it, "model_dump"): # Pydantic v2 object
42
+ rows.append(it.model_dump(by_alias=by_alias))
43
+
44
+ elif isinstance(it, Mapping): # Plain mapping
45
+ rows.append(it)
46
+ else:
47
+ raise ValueError(
48
+ f"Cannot convert item of type {type(it)} to DataFrame row"
49
+ )
50
+
51
+ df = (
52
+ pd.json_normalize(rows, sep=".")
53
+ if json_normalize
54
+ else pd.DataFrame(rows)
55
+ )
56
+
57
+ # Drop None/NaN columns if requested
58
+ if exclude_none in ("any", "all", True):
59
+ drop_how = "all" if exclude_none is True else exclude_none
60
+ df.dropna(axis=1, how=drop_how, inplace=True)
61
+
62
+ if convert_dtypes:
63
+ df = df.convert_dtypes()
64
+ return df
65
+
66
+ return to_df
67
+
68
+
69
+ models.DatasetsList200Response.to_df = make_to_df("datasets") # type: ignore[attr-defined]
70
+ models.DatasetsListExamples200Response.to_df = make_to_df("examples") # type: ignore[attr-defined]