fiddler-client 3.14.1__tar.gz → 3.16.0__tar.gz
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.
- {fiddler_client-3.14.1/fiddler_client.egg-info → fiddler_client-3.16.0}/PKG-INFO +5 -6
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/PUBLIC.md +1 -1
- fiddler_client-3.16.0/fiddler/VERSION +1 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/job.py +8 -11
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/model.py +6 -16
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/exceptions.py +147 -141
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/libs/http_client.py +3 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/libs/semver.py +2 -2
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/model_spec.py +1 -1
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/test_http_client_redaction.py +114 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0/fiddler_client.egg-info}/PKG-INFO +5 -6
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler_client.egg-info/requires.txt +2 -2
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/pyproject.toml +16 -13
- fiddler_client-3.14.1/fiddler/VERSION +0 -1
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/LICENSE.txt +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/README.md +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/configs.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/connection.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/alert_rule.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/baseline.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/common.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/dataset.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/events.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/job.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/model.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/model_deployment.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/constants/xai.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/decorators.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/alert_record.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/alert_rule.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/base.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/baseline.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/custom_expression.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/dataset.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/events.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/file.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/model_artifact.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/model_deployment.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/organization.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/project.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/surrogate.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/user.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/webhook.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/entities/xai.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/libs/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/libs/aws.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/libs/json_encoder.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/packtools/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/packtools/gem.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/packtools/keras_ig_helpers.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/packtools/project_attributions_helpers.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/packtools/template_model.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/alert_record.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/alert_rule.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/base.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/baseline.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/custom_expression.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/custom_features.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/dataset.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/events.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/file.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/filter_query.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/job.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/model.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/model_deployment.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/model_schema.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/model_task_params.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/organization.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/project.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/response.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/server_info.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/user.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/webhook.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/xai.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/schemas/xai_params.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_alert_record.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_alert_rule.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_baseline.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_custom_metric.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_dataset.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_events.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_files.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_generate_model.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_job.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_mixin.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_model.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_model_artifact.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_model_deployment.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_model_surrogate.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_project.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_segment.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_webhook.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/apis/test_xai.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/artifact_test_dir/package.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/conftest.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/constants.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/test_connection.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/test_json_encoder.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/test_logger.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/test_sagemaker_auth.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/test_utils.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/tests/utils.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/__init__.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/column_generator.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/decorators.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/helpers.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/logger.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/model_generator.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/validations.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/utils/version.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler/version.py +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler_client.egg-info/SOURCES.txt +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler_client.egg-info/dependency_links.txt +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/fiddler_client.egg-info/top_level.txt +0 -0
- {fiddler_client-3.14.1 → fiddler_client-3.16.0}/setup.cfg +0 -0
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fiddler-client
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.16.0
|
|
4
4
|
Summary: Python client for Fiddler Platform
|
|
5
5
|
Author: Fiddler Labs
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://fiddler.ai
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
10
9
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.14
|
|
14
13
|
Classifier: Operating System :: OS Independent
|
|
15
|
-
Requires-Python: >=3.
|
|
14
|
+
Requires-Python: >=3.11
|
|
16
15
|
Description-Content-Type: text/markdown
|
|
17
16
|
License-File: LICENSE.txt
|
|
18
|
-
Requires-Dist: requests<3
|
|
17
|
+
Requires-Dist: requests<3,>=2.33.0
|
|
19
18
|
Requires-Dist: requests-toolbelt
|
|
20
19
|
Requires-Dist: pydantic>=2.0
|
|
21
20
|
Requires-Dist: deprecated>=1.2.18
|
|
@@ -24,7 +23,7 @@ Requires-Dist: simplejson>=3.17.0
|
|
|
24
23
|
Requires-Dist: pyyaml
|
|
25
24
|
Requires-Dist: typing-extensions<5,>=4.6.0
|
|
26
25
|
Requires-Dist: pandas>=2.1.0
|
|
27
|
-
Requires-Dist: pyarrow>=
|
|
26
|
+
Requires-Dist: pyarrow>=23.0.1
|
|
28
27
|
Dynamic: license-file
|
|
29
28
|
|
|
30
29
|
# fiddler-client
|
|
@@ -58,7 +57,7 @@ pip install fiddler-client
|
|
|
58
57
|
|
|
59
58
|
## Requirements
|
|
60
59
|
|
|
61
|
-
- Python 3.
|
|
60
|
+
- Python 3.11 or higher
|
|
62
61
|
- pip 19.0 or higher (latest release preferred)
|
|
63
62
|
|
|
64
63
|
## Quick Start
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.16.0
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Job entity for managing asynchronous operations in Fiddler.
|
|
3
3
|
|
|
4
4
|
The Job class represents long-running asynchronous operations in the Fiddler platform,
|
|
5
|
-
such as data publishing
|
|
6
|
-
operations that may take significant time to complete.
|
|
5
|
+
such as data publishing and other operations that may take significant time to complete.
|
|
7
6
|
|
|
8
7
|
Key Concepts:
|
|
9
8
|
- **Async Operations**: Handle long-running tasks without blocking
|
|
@@ -29,8 +28,6 @@ Job Status Types:
|
|
|
29
28
|
|
|
30
29
|
Common Use Cases:
|
|
31
30
|
- **Data Publishing**: Monitor large dataset upload progress
|
|
32
|
-
- **Model Artifacts**: Track model deployment and artifact uploads
|
|
33
|
-
- **Surrogate Training**: Monitor surrogate model training progress
|
|
34
31
|
- **Batch Operations**: Handle bulk data processing jobs
|
|
35
32
|
|
|
36
33
|
Example:
|
|
@@ -75,8 +72,8 @@ logger = logging.getLogger(__name__)
|
|
|
75
72
|
class Job(BaseEntity): # pylint: disable=too-many-instance-attributes
|
|
76
73
|
"""Represents an asynchronous operation in the Fiddler platform.
|
|
77
74
|
|
|
78
|
-
A Job tracks the execution of long-running operations such as data publishing
|
|
79
|
-
|
|
75
|
+
A Job tracks the execution of long-running operations such as data publishing
|
|
76
|
+
and other async tasks. Jobs
|
|
80
77
|
provide status monitoring, progress tracking, and error handling for operations
|
|
81
78
|
that may take significant time to complete.
|
|
82
79
|
|
|
@@ -134,8 +131,8 @@ class Job(BaseEntity): # pylint: disable=too-many-instance-attributes
|
|
|
134
131
|
for direct job creation.
|
|
135
132
|
|
|
136
133
|
Note:
|
|
137
|
-
Jobs are automatically created by async operations (like Model.publish()
|
|
138
|
-
|
|
134
|
+
Jobs are automatically created by async operations (like Model.publish())
|
|
135
|
+
and cannot be created directly. Use Job.get()
|
|
139
136
|
to retrieve existing jobs and monitoring methods to track progress.
|
|
140
137
|
"""
|
|
141
138
|
self.name: str | None = None
|
|
@@ -395,9 +392,9 @@ class Job(BaseEntity): # pylint: disable=too-many-instance-attributes
|
|
|
395
392
|
print("Data publishing completed!")
|
|
396
393
|
|
|
397
394
|
# Custom timeout for long-running jobs
|
|
398
|
-
job = model.
|
|
395
|
+
job = model.publish(source="large_dataset.csv")
|
|
399
396
|
job.wait(timeout=3600) # 1 hour timeout
|
|
400
|
-
print("
|
|
397
|
+
print("Large dataset publishing completed!")
|
|
401
398
|
|
|
402
399
|
# Handle job failures
|
|
403
400
|
try:
|
|
@@ -408,7 +405,7 @@ class Job(BaseEntity): # pylint: disable=too-many-instance-attributes
|
|
|
408
405
|
# Handle failure (retry, alert, etc.)
|
|
409
406
|
|
|
410
407
|
# Fast polling for critical operations
|
|
411
|
-
job = model.
|
|
408
|
+
job = model.publish(source="critical_data.csv")
|
|
412
409
|
job.wait(interval=5, timeout=600) # 5 second polling, 10 min timeout
|
|
413
410
|
|
|
414
411
|
Note:
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
"""Model entity for managing ML models in the Fiddler platform.
|
|
3
3
|
|
|
4
4
|
This module provides the Model class for creating, managing, and monitoring machine learning
|
|
5
|
-
models within Fiddler. Models represent ML systems that can be monitored for drift
|
|
6
|
-
|
|
5
|
+
models within Fiddler. Models represent ML systems that can be monitored for drift
|
|
6
|
+
and performance.
|
|
7
7
|
|
|
8
8
|
Key Features:
|
|
9
9
|
- Create models from DataFrames, files, or manual schema/spec definition
|
|
10
10
|
- Publish production and pre-production data for monitoring
|
|
11
|
-
- Upload and manage model artifacts for serving
|
|
12
|
-
- Generate surrogate models for explainability
|
|
13
11
|
- Monitor model performance and data drift
|
|
14
12
|
- Integrate with alert systems and baselines
|
|
15
13
|
|
|
@@ -92,21 +90,18 @@ class Model( # pylint: disable=too-many-public-methods
|
|
|
92
90
|
|
|
93
91
|
The Model class is the central entity for ML model monitoring and management.
|
|
94
92
|
It encapsulates the model's schema, specification, and metadata, and provides
|
|
95
|
-
methods for data publishing
|
|
93
|
+
methods for data publishing and monitoring operations.
|
|
96
94
|
|
|
97
95
|
Key Concepts:
|
|
98
96
|
- **Schema** (:class:`~fiddler.schemas.ModelSchema`): Defines the structure and data types of model inputs/outputs
|
|
99
97
|
- **Spec** (:class:`~fiddler.schemas.ModelSpec`): Defines how columns are used (features, targets, predictions, etc.)
|
|
100
98
|
- **Task** (:class:`~fiddler.constants.ModelTask`): The ML task type (classification, regression, ranking, etc.)
|
|
101
|
-
- **Artifacts** (:class:`~fiddler.entities.ModelArtifact`): Deployable model code and dependencies
|
|
102
|
-
- **Surrogates** (:class:`~fiddler.entities.Surrogate`): Simplified models for fast explanations
|
|
103
99
|
|
|
104
100
|
Lifecycle:
|
|
105
101
|
1. Create model with schema/spec (from data or manual definition)
|
|
106
|
-
2.
|
|
107
|
-
3. Publish
|
|
108
|
-
4.
|
|
109
|
-
5. Set up alerts and monitoring rules
|
|
102
|
+
2. Publish baseline/training data for drift detection
|
|
103
|
+
3. Publish production data for monitoring
|
|
104
|
+
4. Set up alerts and monitoring rules
|
|
110
105
|
|
|
111
106
|
Common Use Cases:
|
|
112
107
|
- **Tabular Models**: Traditional ML models with structured data
|
|
@@ -128,7 +123,6 @@ class Model( # pylint: disable=too-many-public-methods
|
|
|
128
123
|
event_id_col (str, optional): Column name for unique event identifiers
|
|
129
124
|
event_ts_col (str, optional): Column name for event timestamps
|
|
130
125
|
event_ts_format (str, optional): Timestamp format string
|
|
131
|
-
xai_params (:class:`~fiddler.schemas.XaiParams`): Explainability configuration
|
|
132
126
|
|
|
133
127
|
Examples:
|
|
134
128
|
# Create model from DataFrame with automatic schema detection
|
|
@@ -211,8 +205,6 @@ class Model( # pylint: disable=too-many-public-methods
|
|
|
211
205
|
Used for time-based analysis and drift detection.
|
|
212
206
|
event_ts_format: Format string for parsing timestamps in event_ts_col.
|
|
213
207
|
Examples: '%Y-%m-%d %H:%M:%S', '%Y-%m-%dT%H:%M:%SZ'
|
|
214
|
-
xai_params: :class:`~fiddler.schemas.XaiParams` - Configuration for explainability features like
|
|
215
|
-
explanation methods and custom feature definitions.
|
|
216
208
|
|
|
217
209
|
Note:
|
|
218
210
|
The model exists only locally until .create() is called. Use Model.from_data()
|
|
@@ -894,8 +886,6 @@ class Model( # pylint: disable=too-many-public-methods
|
|
|
894
886
|
analysis, drift detection, and temporal monitoring.
|
|
895
887
|
event_ts_format: Timestamp format string for parsing event_ts_col.
|
|
896
888
|
Examples: '%Y-%m-%d %H:%M:%S', '%Y-%m-%dT%H:%M:%SZ'
|
|
897
|
-
xai_params: :class:`~fiddler.schemas.XaiParams` - Explainability configuration including explanation methods
|
|
898
|
-
and custom feature definitions.
|
|
899
889
|
max_cardinality: Maximum unique values to consider a column categorical.
|
|
900
890
|
Columns with more unique values are treated as continuous.
|
|
901
891
|
Default is typically 100-1000 depending on data size.
|
|
@@ -16,6 +16,12 @@ class BaseError(Exception):
|
|
|
16
16
|
library. It provides common functionality for error handling, message
|
|
17
17
|
formatting, and error identification.
|
|
18
18
|
|
|
19
|
+
``BaseError`` is not exported from the top-level ``fiddler`` package;
|
|
20
|
+
import it from ``fiddler.exceptions``. The client also raises a plain
|
|
21
|
+
``BaseError`` when it gives up retrying a request (timeouts, connection
|
|
22
|
+
failures, HTTP 429, and most 5xx responses); the message says how many
|
|
23
|
+
attempts were made.
|
|
24
|
+
|
|
19
25
|
Attributes:
|
|
20
26
|
message: Human-readable error message describing the issue
|
|
21
27
|
name: Name of the specific error type (class name)
|
|
@@ -23,11 +29,14 @@ class BaseError(Exception):
|
|
|
23
29
|
Examples:
|
|
24
30
|
Catching any Fiddler-specific error:
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
.. code-block:: python
|
|
33
|
+
|
|
34
|
+
from fiddler.exceptions import BaseError
|
|
35
|
+
|
|
36
|
+
try:
|
|
37
|
+
project = fdl.Project.from_name(name="my-project")
|
|
38
|
+
except BaseError as e:
|
|
39
|
+
print(f"Fiddler error occurred: {e.name} - {e.message}")
|
|
31
40
|
"""
|
|
32
41
|
message: str = 'Something went wrong'
|
|
33
42
|
|
|
@@ -55,7 +64,9 @@ class IncompatibleClient(BaseError): # noqa: N818
|
|
|
55
64
|
behavior or missing functionality.
|
|
56
65
|
|
|
57
66
|
The exception includes both the client version and server version in the error
|
|
58
|
-
message to help users understand what versions are involved in the incompatibility
|
|
67
|
+
message to help users understand what versions are involved in the incompatibility,
|
|
68
|
+
for example: *Python Client version (3.8.0) is not compatible with your
|
|
69
|
+
Fiddler Platform version (3.5.0).*
|
|
59
70
|
|
|
60
71
|
Attributes:
|
|
61
72
|
message: Formatted message showing both client and server versions
|
|
@@ -63,15 +74,13 @@ class IncompatibleClient(BaseError): # noqa: N818
|
|
|
63
74
|
Examples:
|
|
64
75
|
Handling version incompatibility:
|
|
65
76
|
|
|
66
|
-
|
|
67
|
-
fdl.init(url="https://old-fiddler.com", token="token")
|
|
68
|
-
except IncompatibleClient as e:
|
|
69
|
-
print(f"Version mismatch: {e.message}")
|
|
70
|
-
# Upgrade client or contact administrator
|
|
77
|
+
.. code-block:: python
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
try:
|
|
80
|
+
fdl.init(url="https://old-fiddler.example.com", token="token")
|
|
81
|
+
except fdl.IncompatibleClient as e:
|
|
82
|
+
print(f"Version mismatch: {e.message}")
|
|
83
|
+
# Upgrade the client or contact your administrator
|
|
75
84
|
"""
|
|
76
85
|
|
|
77
86
|
message = (
|
|
@@ -95,59 +104,49 @@ class AsyncJobFailed(BaseError): # noqa: N818
|
|
|
95
104
|
data processing, or batch operations) fail to complete successfully. The job
|
|
96
105
|
may have been submitted successfully but encountered an error during execution.
|
|
97
106
|
|
|
98
|
-
Async jobs in Fiddler include operations like
|
|
107
|
+
Async jobs in Fiddler include operations like baseline
|
|
99
108
|
computations, batch data ingestion, and other time-intensive operations that
|
|
100
109
|
run in the background.
|
|
101
110
|
|
|
102
111
|
Examples:
|
|
103
112
|
Handling async job failures:
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
job.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
job = model.upload_artifact(artifact_path)
|
|
115
|
-
while not job.is_complete():
|
|
116
|
-
if job.status == JobStatus.FAILED:
|
|
117
|
-
print(f"Job failed: {job.error_message}")
|
|
118
|
-
break
|
|
119
|
-
time.sleep(5)
|
|
114
|
+
.. code-block:: python
|
|
115
|
+
|
|
116
|
+
job = model.publish(source="large_dataset.csv")
|
|
117
|
+
try:
|
|
118
|
+
job.wait() # Raises AsyncJobFailed if the job fails
|
|
119
|
+
except fdl.AsyncJobFailed as e:
|
|
120
|
+
print(f"Job failed: {e.message}")
|
|
121
|
+
# Check the job details or retry the operation
|
|
120
122
|
"""
|
|
121
123
|
|
|
122
124
|
|
|
123
125
|
class Unsupported(BaseError): # noqa: N818
|
|
124
126
|
"""Raised when an unsupported operation is attempted.
|
|
125
127
|
|
|
126
|
-
This exception occurs when
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
This exception occurs when you call a client method that has been retired,
|
|
129
|
+
or when the Fiddler platform rejects a request with HTTP 405
|
|
130
|
+
(Method Not Allowed).
|
|
131
|
+
|
|
132
|
+
Common unsupported scenarios:
|
|
130
133
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
operations incompatible with the model's configuration.
|
|
134
|
+
- Calling a method retired in an earlier client version
|
|
135
|
+
- An operation the platform rejects with HTTP 405 (Method Not Allowed)
|
|
134
136
|
|
|
135
137
|
Attributes:
|
|
136
138
|
message: Description of the unsupported operation
|
|
137
139
|
|
|
138
140
|
Examples:
|
|
139
|
-
Handling
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
- Using enterprise features on basic plans
|
|
149
|
-
- Attempting operations on incompatible model types
|
|
150
|
-
- Calling deprecated API methods
|
|
141
|
+
Handling a method that is no longer supported:
|
|
142
|
+
|
|
143
|
+
.. code-block:: python
|
|
144
|
+
|
|
145
|
+
try:
|
|
146
|
+
df = model.get_slice(query="SELECT * FROM my_table")
|
|
147
|
+
except fdl.Unsupported as e:
|
|
148
|
+
print(f"Not supported: {e.message}")
|
|
149
|
+
# The message names the replacement, e.g. model.download_data
|
|
151
150
|
"""
|
|
152
151
|
|
|
153
152
|
message = 'This operation is not supported'
|
|
@@ -156,23 +155,26 @@ class Unsupported(BaseError): # noqa: N818
|
|
|
156
155
|
class HttpError(BaseError):
|
|
157
156
|
"""Base class for all HTTP-related errors.
|
|
158
157
|
|
|
159
|
-
This is the parent class
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
This is the parent class of :class:`ApiError` (and so of
|
|
159
|
+
:class:`NotFound` and :class:`Conflict`). It is also raised directly when
|
|
160
|
+
an API response body is not valid JSON (message starting
|
|
161
|
+
``Invalid JSON response``).
|
|
163
162
|
|
|
164
163
|
Note:
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
Catching ``HttpError`` does not catch every failed request: HTTP 405
|
|
165
|
+
is raised as :class:`Unsupported`, an error response without a
|
|
166
|
+
structured body is re-raised as ``requests.HTTPError``, and a request
|
|
167
|
+
the client gave up retrying ends in a plain ``BaseError``.
|
|
167
168
|
|
|
168
169
|
Examples:
|
|
169
|
-
Catching
|
|
170
|
+
Catching Fiddler API errors and invalid JSON responses:
|
|
171
|
+
|
|
172
|
+
.. code-block:: python
|
|
170
173
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
print(f"HTTP error: {e.message}")
|
|
174
|
+
try:
|
|
175
|
+
project = fdl.Project.from_name(name="my-project")
|
|
176
|
+
except fdl.HttpError as e:
|
|
177
|
+
print(f"HTTP error: {e.message}")
|
|
176
178
|
"""
|
|
177
179
|
|
|
178
180
|
|
|
@@ -185,22 +187,25 @@ class ConnTimeout(HttpError): # noqa: N818
|
|
|
185
187
|
configured timeout period.
|
|
186
188
|
|
|
187
189
|
Note:
|
|
188
|
-
This class is deprecated and not thrown anymore
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
This class is deprecated and not thrown anymore, so
|
|
191
|
+
``except fdl.ConnTimeout`` never fires. A timed-out request is retried,
|
|
192
|
+
and when the client gives up it raises a plain ``BaseError``; catch
|
|
193
|
+
that instead, and raise the timeout in ``fdl.init()`` if needed.
|
|
191
194
|
|
|
192
195
|
Attributes:
|
|
193
196
|
message: Timeout-specific error message
|
|
194
197
|
|
|
195
198
|
Examples:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
Catching a request that failed after retries:
|
|
200
|
+
|
|
201
|
+
.. code-block:: python
|
|
202
|
+
|
|
203
|
+
from fiddler.exceptions import BaseError
|
|
204
|
+
|
|
205
|
+
try:
|
|
206
|
+
project = fdl.Project.from_name(name="my-project")
|
|
207
|
+
except BaseError as e:
|
|
208
|
+
print(f"Request failed after retries: {e.message}")
|
|
204
209
|
"""
|
|
205
210
|
|
|
206
211
|
message = 'Request timed out while trying to reach endpoint'
|
|
@@ -214,22 +219,25 @@ class ConnError(HttpError):
|
|
|
214
219
|
unreachability, DNS resolution failures, or connection refused errors.
|
|
215
220
|
|
|
216
221
|
Note:
|
|
217
|
-
This class is deprecated and not thrown anymore
|
|
218
|
-
|
|
219
|
-
|
|
222
|
+
This class is deprecated and not thrown anymore, so
|
|
223
|
+
``except fdl.ConnError`` never fires. A failed connection (for example
|
|
224
|
+
a DNS error or a refused connection) is retried, and when the client
|
|
225
|
+
gives up it raises a plain ``BaseError``; catch that instead.
|
|
220
226
|
|
|
221
227
|
Attributes:
|
|
222
228
|
message: Connection-specific error message
|
|
223
229
|
|
|
224
230
|
Examples:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
Catching a request that failed after retries:
|
|
232
|
+
|
|
233
|
+
.. code-block:: python
|
|
234
|
+
|
|
235
|
+
from fiddler.exceptions import BaseError
|
|
236
|
+
|
|
237
|
+
try:
|
|
238
|
+
project = fdl.Project.from_name(name="my-project")
|
|
239
|
+
except BaseError as e:
|
|
240
|
+
print(f"Request failed after retries: {e.message}")
|
|
233
241
|
"""
|
|
234
242
|
|
|
235
243
|
message = 'Unable to reach the given endpoint'
|
|
@@ -248,6 +256,9 @@ class ApiError(HttpError):
|
|
|
248
256
|
NotFound and Conflict, but can also be raised directly for other
|
|
249
257
|
HTTP error status codes.
|
|
250
258
|
|
|
259
|
+
You won't see HTTP 429 or most 5xx codes here: the client retries those
|
|
260
|
+
itself and, when it gives up, raises a plain ``BaseError`` instead.
|
|
261
|
+
|
|
251
262
|
Attributes:
|
|
252
263
|
code: HTTP status code returned by the API
|
|
253
264
|
message: Error message from the API response
|
|
@@ -257,26 +268,26 @@ class ApiError(HttpError):
|
|
|
257
268
|
Examples:
|
|
258
269
|
Handling general API errors:
|
|
259
270
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
print(f"
|
|
271
|
+
.. code-block:: python
|
|
272
|
+
|
|
273
|
+
try:
|
|
274
|
+
model = fdl.Model.from_name(name="my-model", project_id=project.id)
|
|
275
|
+
except fdl.ApiError as e:
|
|
276
|
+
print(f"API Error {e.code}: {e.message}")
|
|
277
|
+
if e.errors:
|
|
278
|
+
print(f"Details: {e.errors}")
|
|
266
279
|
|
|
267
280
|
Handling specific status codes:
|
|
268
281
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
else:
|
|
279
|
-
print(f"Client error: {e.message}")
|
|
282
|
+
.. code-block:: python
|
|
283
|
+
|
|
284
|
+
try:
|
|
285
|
+
model = fdl.Model.from_name(name="my-model", project_id=project.id)
|
|
286
|
+
except fdl.ApiError as e:
|
|
287
|
+
if e.code in (401, 403):
|
|
288
|
+
print("Check your token and its permissions")
|
|
289
|
+
else:
|
|
290
|
+
print(f"API error {e.code}: {e.message}")
|
|
280
291
|
"""
|
|
281
292
|
|
|
282
293
|
code: int = HTTPStatus.INTERNAL_SERVER_ERROR
|
|
@@ -299,8 +310,11 @@ class NotFound(ApiError): # noqa: N818
|
|
|
299
310
|
projects, datasets, alerts, or any other entity that cannot be located
|
|
300
311
|
using the provided identifier.
|
|
301
312
|
|
|
302
|
-
Common scenarios
|
|
303
|
-
|
|
313
|
+
Common NotFound scenarios:
|
|
314
|
+
|
|
315
|
+
- Accessing models, projects, or datasets with wrong IDs
|
|
316
|
+
- Referencing deleted or expired resources
|
|
317
|
+
- Typos in resource names or identifiers
|
|
304
318
|
|
|
305
319
|
Attributes:
|
|
306
320
|
code: Always set to 404 (HTTP_NOT_FOUND)
|
|
@@ -310,25 +324,26 @@ class NotFound(ApiError): # noqa: N818
|
|
|
310
324
|
Examples:
|
|
311
325
|
Handling missing resources:
|
|
312
326
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
327
|
+
.. code-block:: python
|
|
328
|
+
|
|
329
|
+
try:
|
|
330
|
+
model = fdl.Model.from_name(name="wrong-model-name", project_id=project.id)
|
|
331
|
+
except fdl.NotFound as e:
|
|
332
|
+
print(f"Model not found: {e.message}")
|
|
333
|
+
# Create the model or check the name
|
|
318
334
|
|
|
319
335
|
Checking if a resource exists:
|
|
320
336
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
- Typos in resource names or identifiers
|
|
337
|
+
.. code-block:: python
|
|
338
|
+
|
|
339
|
+
try:
|
|
340
|
+
project = fdl.Project.from_name(name="my-project")
|
|
341
|
+
print("Project exists")
|
|
342
|
+
except fdl.NotFound:
|
|
343
|
+
print("Project doesn't exist, creating it...")
|
|
344
|
+
project = fdl.Project(name="my-project").create()
|
|
345
|
+
|
|
346
|
+
# fdl.Project.get_or_create(name="my-project") does both in one call
|
|
332
347
|
"""
|
|
333
348
|
code: int = HTTPStatus.NOT_FOUND
|
|
334
349
|
"""HTTP status code; always ``404`` (``HTTPStatus.NOT_FOUND``)."""
|
|
@@ -344,9 +359,12 @@ class Conflict(ApiError): # noqa: N818
|
|
|
344
359
|
create resources that already exist, or when concurrent modifications cause
|
|
345
360
|
state conflicts.
|
|
346
361
|
|
|
347
|
-
Common scenarios
|
|
348
|
-
|
|
349
|
-
|
|
362
|
+
Common Conflict scenarios:
|
|
363
|
+
|
|
364
|
+
- Creating resources with duplicate names
|
|
365
|
+
- Modifying resources during processing
|
|
366
|
+
- Violating business logic constraints
|
|
367
|
+
- Concurrent modification conflicts
|
|
350
368
|
|
|
351
369
|
Attributes:
|
|
352
370
|
code: Always set to 409 (HTTP_CONFLICT)
|
|
@@ -356,26 +374,14 @@ class Conflict(ApiError): # noqa: N818
|
|
|
356
374
|
Examples:
|
|
357
375
|
Handling resource conflicts:
|
|
358
376
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
try:
|
|
369
|
-
model.update_status("active")
|
|
370
|
-
except Conflict as e:
|
|
371
|
-
print(f"Cannot change status: {e.message}")
|
|
372
|
-
# Wait for current operation to complete
|
|
373
|
-
|
|
374
|
-
Common Conflict scenarios:
|
|
375
|
-
- Creating resources with duplicate names
|
|
376
|
-
- Modifying resources during processing
|
|
377
|
-
- Violating business logic constraints
|
|
378
|
-
- Concurrent modification conflicts
|
|
377
|
+
.. code-block:: python
|
|
378
|
+
|
|
379
|
+
try:
|
|
380
|
+
project = fdl.Project(name="existing-project").create()
|
|
381
|
+
except fdl.Conflict as e:
|
|
382
|
+
print(f"Project already exists: {e.message}")
|
|
383
|
+
# Use the existing project or choose a different name
|
|
384
|
+
project = fdl.Project.from_name(name="existing-project")
|
|
379
385
|
"""
|
|
380
386
|
code: int = HTTPStatus.CONFLICT
|
|
381
387
|
"""HTTP status code; always ``409`` (``HTTPStatus.CONFLICT``)."""
|
|
@@ -29,6 +29,9 @@ _SENSITIVE_HEADERS = frozenset(
|
|
|
29
29
|
'proxy-authorization',
|
|
30
30
|
'x-api-key',
|
|
31
31
|
'x-amz-security-token',
|
|
32
|
+
# In SageMaker Partner App mode the SageMaker SDK copies the API key
|
|
33
|
+
# from `Authorization` into this header.
|
|
34
|
+
'x-amz-partner-app-authorization',
|
|
32
35
|
}
|
|
33
36
|
)
|
|
34
37
|
_REDACTED = '**REDACTED**'
|
|
@@ -298,11 +298,11 @@ class VersionInfo:
|
|
|
298
298
|
return self.compare(other) != 0
|
|
299
299
|
|
|
300
300
|
@comparator
|
|
301
|
-
def __lt__(self, other: VersionInfo) -> bool:
|
|
301
|
+
def __lt__(self, other: VersionInfo) -> bool:
|
|
302
302
|
return self.compare(other) < 0
|
|
303
303
|
|
|
304
304
|
@comparator
|
|
305
|
-
def __le__(self, other: VersionInfo) -> bool:
|
|
305
|
+
def __le__(self, other: VersionInfo) -> bool:
|
|
306
306
|
return self.compare(other) <= 0
|
|
307
307
|
|
|
308
308
|
@comparator
|
|
@@ -20,7 +20,7 @@ class ModelSpec(BaseModel):
|
|
|
20
20
|
that enhance model monitoring and analysis capabilities.
|
|
21
21
|
|
|
22
22
|
This specification is crucial for Fiddler to understand your model's structure,
|
|
23
|
-
enabling proper monitoring, drift detection, bias analysis
|
|
23
|
+
enabling proper monitoring, drift detection, and bias analysis
|
|
24
24
|
features. It acts as the contract between your model and Fiddler's monitoring
|
|
25
25
|
infrastructure.
|
|
26
26
|
|