fiddler-client 3.8.0__tar.gz → 3.8.1__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.8.0/fiddler_client.egg-info → fiddler-client-3.8.1}/PKG-INFO +1 -1
- fiddler-client-3.8.1/fiddler/VERSION +1 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/alert_rule.py +4 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/alert_rule.py +1 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_alert_rule.py +49 -23
- {fiddler-client-3.8.0 → fiddler-client-3.8.1/fiddler_client.egg-info}/PKG-INFO +1 -1
- fiddler-client-3.8.0/fiddler/VERSION +0 -1
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/LICENSE.txt +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/MANIFEST.in +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/PUBLIC.md +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/README.md +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/configs.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/connection.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/alert_rule.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/baseline.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/common.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/dataset.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/events.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/job.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/model.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/model_deployment.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/constants/xai.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/decorators.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/alert_record.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/base.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/baseline.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/custom_expression.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/dataset.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/events.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/file.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/job.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/model.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/model_artifact.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/model_deployment.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/organization.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/project.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/surrogate.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/user.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/webhook.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/entities/xai.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/exceptions.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/libs/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/libs/aws.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/libs/http_client.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/libs/json_encoder.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/libs/semver.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/packtools/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/packtools/gem.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/packtools/keras_ig_helpers.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/packtools/project_attributions_helpers.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/packtools/template_model.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/alert_record.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/base.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/baseline.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/custom_expression.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/custom_features.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/dataset.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/events.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/file.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/filter_query.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/job.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/model.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/model_deployment.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/model_schema.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/model_spec.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/model_task_params.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/organization.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/project.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/response.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/server_info.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/user.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/webhook.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/xai.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/schemas/xai_params.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_alert_record.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_baseline.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_custom_metric.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_dataset.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_events.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_files.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_generate_model.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_job.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_mixin.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_model.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_model_artifact.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_model_deployment.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_model_surrogate.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_project.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_segment.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_webhook.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/apis/test_xai.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/conftest.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/constants.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/test_connection.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/test_json_encoder.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/test_logger.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/test_sagemaker_auth.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/test_utils.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/tests/utils.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/utils/__init__.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/utils/decorators.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/utils/helpers.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/utils/logger.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/utils/model_generator.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/utils/validations.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/utils/version.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/version.py +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler_client.egg-info/SOURCES.txt +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler_client.egg-info/dependency_links.txt +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler_client.egg-info/requires.txt +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler_client.egg-info/top_level.txt +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/setup.cfg +0 -0
- {fiddler-client-3.8.0 → fiddler-client-3.8.1}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.8.1
|
|
@@ -48,6 +48,7 @@ class AlertRule(
|
|
|
48
48
|
segment_id: UUID | str | None = None,
|
|
49
49
|
compare_bin_delta: int | None = None,
|
|
50
50
|
evaluation_delay: int = 0,
|
|
51
|
+
category: str | None = None,
|
|
51
52
|
) -> None:
|
|
52
53
|
"""Construct a alert rule instance."""
|
|
53
54
|
self.name = name
|
|
@@ -65,6 +66,7 @@ class AlertRule(
|
|
|
65
66
|
self.condition = condition
|
|
66
67
|
self.bin_size = bin_size
|
|
67
68
|
self.segment_id = segment_id
|
|
69
|
+
self.category = category
|
|
68
70
|
|
|
69
71
|
self.id: UUID | None = None
|
|
70
72
|
self.project_id: UUID | None = None
|
|
@@ -110,6 +112,7 @@ class AlertRule(
|
|
|
110
112
|
segment_id=resp_obj.segment.id if resp_obj.segment else None,
|
|
111
113
|
compare_bin_delta=resp_obj.compare_bin_delta,
|
|
112
114
|
evaluation_delay=resp_obj.evaluation_delay,
|
|
115
|
+
category=resp_obj.category
|
|
113
116
|
)
|
|
114
117
|
|
|
115
118
|
# Add remaining fields
|
|
@@ -240,6 +243,7 @@ class AlertRule(
|
|
|
240
243
|
'feature_names': self.columns,
|
|
241
244
|
'compare_bin_delta': self.compare_bin_delta,
|
|
242
245
|
'evaluation_delay': self.evaluation_delay,
|
|
246
|
+
'category': self.category,
|
|
243
247
|
}
|
|
244
248
|
if self.baseline_id:
|
|
245
249
|
payload['baseline_id'] = self.baseline_id
|
|
@@ -18,10 +18,6 @@ from fiddler.constants.alert_rule import (
|
|
|
18
18
|
from fiddler.entities.alert_rule import AlertRule
|
|
19
19
|
from fiddler.exceptions import NotFound
|
|
20
20
|
from fiddler.schemas.alert_rule import NotificationConfig
|
|
21
|
-
from fiddler.tests.apis.test_baseline import (
|
|
22
|
-
API_RESPONSE_200 as BASELINE_API_RESPONSE_200,
|
|
23
|
-
)
|
|
24
|
-
from fiddler.tests.apis.test_model import API_RESPONSE_200 as MODEL_API_RESPONSE_200
|
|
25
21
|
from fiddler.tests.constants import (
|
|
26
22
|
ALERT_RULE_ID,
|
|
27
23
|
BASELINE_ID,
|
|
@@ -258,22 +254,14 @@ def test_delete_alert_rule_not_found() -> None:
|
|
|
258
254
|
|
|
259
255
|
|
|
260
256
|
@responses.activate
|
|
261
|
-
def
|
|
262
|
-
responses.get(
|
|
263
|
-
url=f'{URL}/v3/models/{MODEL_ID}',
|
|
264
|
-
json=MODEL_API_RESPONSE_200,
|
|
265
|
-
)
|
|
266
|
-
responses.get(
|
|
267
|
-
url=f'{URL}/v3/baselines/{BASELINE_ID}',
|
|
268
|
-
json=BASELINE_API_RESPONSE_200,
|
|
269
|
-
)
|
|
257
|
+
def test_add_alert_rule_success_manual_thresholds(mocker) -> None:
|
|
270
258
|
responses.post(
|
|
271
259
|
url=f'{URL}/v3/alert-rules',
|
|
272
260
|
json=API_RESPONSE_200,
|
|
273
261
|
)
|
|
274
262
|
|
|
275
263
|
# Test with manual threshold
|
|
276
|
-
|
|
264
|
+
alert_rule_1 = AlertRule(
|
|
277
265
|
name='alert_name',
|
|
278
266
|
model_id=MODEL_ID,
|
|
279
267
|
metric_id='drift',
|
|
@@ -288,16 +276,54 @@ def test_add_alert_rule_success(mocker) -> None:
|
|
|
288
276
|
evaluation_delay=10,
|
|
289
277
|
).create()
|
|
290
278
|
|
|
291
|
-
assert isinstance(
|
|
292
|
-
assert
|
|
293
|
-
assert
|
|
294
|
-
assert
|
|
295
|
-
assert
|
|
296
|
-
assert
|
|
297
|
-
assert
|
|
298
|
-
assert
|
|
279
|
+
assert isinstance(alert_rule_1, AlertRule)
|
|
280
|
+
assert alert_rule_1.id == UUID(ALERT_RULE_ID)
|
|
281
|
+
assert alert_rule_1.model.id == UUID(MODEL_ID)
|
|
282
|
+
assert alert_rule_1.project_id == UUID(PROJECT_ID)
|
|
283
|
+
assert alert_rule_1.evaluation_delay == 10
|
|
284
|
+
assert alert_rule_1.threshold_type == AlertThresholdAlgo.MANUAL.value
|
|
285
|
+
assert alert_rule_1.critical_threshold == 2.0
|
|
286
|
+
assert alert_rule_1.warning_threshold == 1.0
|
|
299
287
|
|
|
300
|
-
#
|
|
288
|
+
# create one alert rule with category field
|
|
289
|
+
mocker.patch.dict(
|
|
290
|
+
API_RESPONSE_200['data'],
|
|
291
|
+
{
|
|
292
|
+
'metric_id': 'frequency',
|
|
293
|
+
'feature_names': ['geography'],
|
|
294
|
+
'category': 'France',
|
|
295
|
+
},
|
|
296
|
+
)
|
|
297
|
+
alert_rule_2 = AlertRule(
|
|
298
|
+
name='alert_name',
|
|
299
|
+
model_id=MODEL_ID,
|
|
300
|
+
metric_id='frequency',
|
|
301
|
+
priority=Priority.HIGH,
|
|
302
|
+
compare_to=CompareTo.RAW_VALUE,
|
|
303
|
+
condition=AlertCondition.GREATER,
|
|
304
|
+
bin_size=BinSize.HOUR,
|
|
305
|
+
threshold_type=AlertThresholdAlgo.MANUAL.value,
|
|
306
|
+
critical_threshold=2.0,
|
|
307
|
+
warning_threshold=1.0,
|
|
308
|
+
evaluation_delay=10,
|
|
309
|
+
columns=['geography'],
|
|
310
|
+
category='France',
|
|
311
|
+
).create()
|
|
312
|
+
|
|
313
|
+
assert isinstance(alert_rule_2, AlertRule)
|
|
314
|
+
assert alert_rule_2.id == UUID(ALERT_RULE_ID)
|
|
315
|
+
assert alert_rule_2.model.id == UUID(MODEL_ID)
|
|
316
|
+
assert alert_rule_2.project_id == UUID(PROJECT_ID)
|
|
317
|
+
assert alert_rule_2.evaluation_delay == 10
|
|
318
|
+
assert alert_rule_2.threshold_type == AlertThresholdAlgo.MANUAL.value
|
|
319
|
+
assert alert_rule_2.critical_threshold == 2.0
|
|
320
|
+
assert alert_rule_2.warning_threshold == 1.0
|
|
321
|
+
assert alert_rule_2.columns == ['geography']
|
|
322
|
+
assert alert_rule_2.category == 'France'
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
@responses.activate
|
|
326
|
+
def test_add_alert_rule_success_auto_thresholds(mocker) -> None:
|
|
301
327
|
mocker.patch.dict(
|
|
302
328
|
API_RESPONSE_200['data'],
|
|
303
329
|
{
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.8.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fiddler-client-3.8.0 → fiddler-client-3.8.1}/fiddler/packtools/project_attributions_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|