arize 8.0.0b1__tar.gz → 8.0.0b4__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.
- {arize-8.0.0b1 → arize-8.0.0b4}/.gitignore +1 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/PKG-INFO +32 -7
- {arize-8.0.0b1 → arize-8.0.0b4}/README.md +22 -5
- arize-8.0.0b4/pyproject.toml +290 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/__init__.py +9 -2
- arize-8.0.0b4/src/arize/_client_factory.py +50 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_exporter/client.py +18 -17
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_exporter/parsers/tracing_data_parser.py +9 -4
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_exporter/validation.py +1 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_flight/client.py +37 -17
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/api/datasets_api.py +6 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/api/experiments_api.py +6 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/api/projects_api.py +3 -3
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_lazy.py +61 -10
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/client.py +66 -50
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/config.py +175 -48
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/constants/config.py +1 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/constants/ml.py +9 -16
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/constants/spans.py +5 -10
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/datasets/client.py +45 -28
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/datasets/errors.py +1 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/datasets/validation.py +2 -2
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/auto_generator.py +16 -9
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/base_generators.py +15 -9
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/cv_generators.py +2 -2
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/errors.py +2 -2
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/nlp_generators.py +8 -8
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/tabular_generators.py +6 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/exceptions/base.py +0 -52
- arize-8.0.0b4/src/arize/exceptions/config.py +22 -0
- arize-8.0.0b4/src/arize/exceptions/parameters.py +91 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/exceptions/values.py +8 -5
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/__init__.py +4 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/client.py +31 -18
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/evaluators/base.py +12 -9
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/evaluators/executors.py +16 -7
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/evaluators/rate_limiters.py +3 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/evaluators/types.py +9 -7
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/evaluators/utils.py +7 -5
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/functions.py +128 -58
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/tracing.py +4 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/types.py +34 -31
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/logging.py +54 -33
- arize-8.0.0b4/src/arize/ml/batch_validation/errors.py +629 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/batch_validation/validator.py +351 -291
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/bounded_executor.py +25 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/casting.py +51 -33
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/client.py +43 -35
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/proto.py +21 -22
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/stream_validation.py +64 -27
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/surrogate_explainer/mimic.py +18 -10
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/types.py +27 -67
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/pre_releases.py +10 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/projects/client.py +9 -4
- arize-8.0.0b4/src/arize/py.typed +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/regions.py +11 -11
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/client.py +125 -31
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/columns.py +32 -36
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/conversion.py +12 -11
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/annotations/dataframe_form_validation.py +1 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/annotations/value_validation.py +11 -14
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/common/argument_validation.py +3 -3
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/common/dataframe_form_validation.py +7 -7
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/common/value_validation.py +11 -14
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/evals/dataframe_form_validation.py +4 -4
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/evals/evals_validation.py +6 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/evals/value_validation.py +1 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/metadata/argument_validation.py +1 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/metadata/dataframe_form_validation.py +2 -2
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/metadata/value_validation.py +23 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/spans/dataframe_form_validation.py +2 -2
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/spans/spans_validation.py +6 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/arrow.py +38 -2
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/cache.py +2 -2
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/dataframe.py +4 -4
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/online_tasks/dataframe_preprocessor.py +15 -11
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/openinference_conversion.py +10 -10
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/proto.py +0 -1
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/types.py +6 -6
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/version.py +1 -1
- arize-8.0.0b1/pyproject.toml +0 -171
- arize-8.0.0b1/src/arize/exceptions/parameters.py +0 -420
- arize-8.0.0b1/src/arize/ml/batch_validation/errors.py +0 -1623
- {arize-8.0.0b1 → arize-8.0.0b4}/LICENSE +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/NOTICE +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_exporter/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_exporter/parsers/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_flight/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_flight/types.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/api/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/api_client.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/api_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/configuration.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/exceptions.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/dataset.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/dataset_example.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/dataset_example_update.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/dataset_version.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/datasets_create_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/datasets_examples_insert_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/datasets_examples_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/datasets_examples_update_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/datasets_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/experiment.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/experiment_run.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/experiment_run_create.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/experiments_create_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/experiments_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/experiments_runs_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/pagination_metadata.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/problem.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/project.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/projects_create_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/models/projects_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/rest.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_dataset.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_dataset_example.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_dataset_example_update.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_dataset_version.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_datasets_api.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_datasets_create_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_datasets_examples_insert_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_datasets_examples_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_datasets_examples_update_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_datasets_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_experiment.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_experiment_run.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_experiment_run_create.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_experiments_api.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_experiments_create_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_experiments_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_experiments_runs_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_pagination_metadata.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_problem.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_project.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_projects_api.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_projects_create_request.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client/test/test_projects_list200_response.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/api_client_README.md +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/protocol/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/protocol/flight/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/protocol/flight/flight_pb2.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/protocol/rec/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/_generated/protocol/rec/public_pb2.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/constants/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/constants/model_mapping.json +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/constants/openinference.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/constants/pyarrow.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/datasets/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/constants.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/embeddings/usecases.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/exceptions/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/exceptions/auth.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/exceptions/models.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/exceptions/spaces.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/exceptions/types.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/evaluators/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/experiments/evaluators/exceptions.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/batch_validation/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/ml/surrogate_explainer/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/projects/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/annotations/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/annotations/annotations_validation.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/common/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/common/errors.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/evals/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/metadata/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/spans/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/spans/validation/spans/value_validation.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/online_tasks/__init__.py +0 -0
- {arize-8.0.0b1 → arize-8.0.0b4}/src/arize/utils/size.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: arize
|
|
3
|
-
Version: 8.0.
|
|
3
|
+
Version: 8.0.0b4
|
|
4
4
|
Summary: A helper library to interact with Arize AI APIs
|
|
5
5
|
Project-URL: Homepage, https://arize.com
|
|
6
6
|
Project-URL: Documentation, https://docs.arize.com/arize
|
|
@@ -44,8 +44,16 @@ Requires-Dist: typing-extensions<5,>=4.7.1
|
|
|
44
44
|
Requires-Dist: urllib3<3,>=2.1.0
|
|
45
45
|
Requires-Dist: wrapt<2.0.0,>=1.0.0
|
|
46
46
|
Provides-Extra: dev
|
|
47
|
+
Requires-Dist: mypy==1.19.1; extra == 'dev'
|
|
48
|
+
Requires-Dist: pandas-stubs>=2.2.0; extra == 'dev'
|
|
49
|
+
Requires-Dist: pytest-cov==6.0.0; extra == 'dev'
|
|
47
50
|
Requires-Dist: pytest==8.4.2; extra == 'dev'
|
|
48
|
-
Requires-Dist: ruff==0.
|
|
51
|
+
Requires-Dist: ruff==0.14.9; extra == 'dev'
|
|
52
|
+
Requires-Dist: taskipy<2,>=1.14.1; extra == 'dev'
|
|
53
|
+
Requires-Dist: types-python-dateutil>=2.9.0; extra == 'dev'
|
|
54
|
+
Requires-Dist: types-requests>=2.31.0; extra == 'dev'
|
|
55
|
+
Requires-Dist: types-tabulate>=0.9.0; extra == 'dev'
|
|
56
|
+
Requires-Dist: types-tqdm>=4.66.0; extra == 'dev'
|
|
49
57
|
Provides-Extra: embeddings
|
|
50
58
|
Requires-Dist: datasets!=2.14.*,<3,>=2.8; extra == 'embeddings'
|
|
51
59
|
Requires-Dist: pillow<11,>=8.4.0; extra == 'embeddings'
|
|
@@ -81,6 +89,8 @@ Description-Content-Type: text/markdown
|
|
|
81
89
|
- [Overview](#overview)
|
|
82
90
|
- [Key Features](#key-features)
|
|
83
91
|
- [Installation](#installation)
|
|
92
|
+
- [Optional Dependencies](#optional-dependencies)
|
|
93
|
+
- [Migrating from Version 7](#migrating-from-version-7)
|
|
84
94
|
- [Usage](#usage)
|
|
85
95
|
- [Instrumentation](#instrumentation)
|
|
86
96
|
- [Operations on Spans](#operations-on-spans)
|
|
@@ -140,19 +150,34 @@ We log over 1 trillion inferences and spans, 10 million evaluation runs, and 2 m
|
|
|
140
150
|
|
|
141
151
|
# Installation
|
|
142
152
|
|
|
143
|
-
Install
|
|
153
|
+
Install the base package:
|
|
144
154
|
|
|
145
155
|
```bash
|
|
146
|
-
pip install
|
|
156
|
+
pip install arize
|
|
147
157
|
```
|
|
148
158
|
|
|
149
|
-
|
|
150
|
-
|
|
159
|
+
## Optional Dependencies
|
|
160
|
+
|
|
161
|
+
The following optional extras provide specialized functionality:
|
|
162
|
+
|
|
163
|
+
> **Note:** The `otel` extra installs the `arize-otel` package, which is also available as a standalone package. If you only need auto-instrumentation without the full SDK, install `arize-otel` directly.
|
|
164
|
+
|
|
165
|
+
| Extra | Install Command | What It Provides |
|
|
166
|
+
|-------|----------------|------------------|
|
|
167
|
+
| **otel** | `pip install arize[otel]` | OpenTelemetry auto-instrumentation package (arize-otel) for automatic tracing |
|
|
168
|
+
| **embeddings** | `pip install arize[embeddings]` | Automatic embedding generation for NLP, CV, and structured data (Pillow, datasets, tokenizers, torch, transformers) |
|
|
169
|
+
| **mimic** | `pip install arize[mimic]` | MIMIC explainer for model interpretability |
|
|
170
|
+
|
|
171
|
+
Install multiple extras:
|
|
151
172
|
|
|
152
173
|
```bash
|
|
153
|
-
pip install arize
|
|
174
|
+
pip install arize[otel,embeddings,mimic]
|
|
154
175
|
```
|
|
155
176
|
|
|
177
|
+
## Migrating from Version 7
|
|
178
|
+
|
|
179
|
+
If you're upgrading from version 7, please refer to the [Migration Guide](https://arize.com/docs/api-clients/python/version-8/migration) for detailed migration steps and breaking changes.
|
|
180
|
+
|
|
156
181
|
# Usage
|
|
157
182
|
|
|
158
183
|
## Instrumentation
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
- [Overview](#overview)
|
|
22
22
|
- [Key Features](#key-features)
|
|
23
23
|
- [Installation](#installation)
|
|
24
|
+
- [Optional Dependencies](#optional-dependencies)
|
|
25
|
+
- [Migrating from Version 7](#migrating-from-version-7)
|
|
24
26
|
- [Usage](#usage)
|
|
25
27
|
- [Instrumentation](#instrumentation)
|
|
26
28
|
- [Operations on Spans](#operations-on-spans)
|
|
@@ -80,19 +82,34 @@ We log over 1 trillion inferences and spans, 10 million evaluation runs, and 2 m
|
|
|
80
82
|
|
|
81
83
|
# Installation
|
|
82
84
|
|
|
83
|
-
Install
|
|
85
|
+
Install the base package:
|
|
84
86
|
|
|
85
87
|
```bash
|
|
86
|
-
pip install
|
|
88
|
+
pip install arize
|
|
87
89
|
```
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
## Optional Dependencies
|
|
92
|
+
|
|
93
|
+
The following optional extras provide specialized functionality:
|
|
94
|
+
|
|
95
|
+
> **Note:** The `otel` extra installs the `arize-otel` package, which is also available as a standalone package. If you only need auto-instrumentation without the full SDK, install `arize-otel` directly.
|
|
96
|
+
|
|
97
|
+
| Extra | Install Command | What It Provides |
|
|
98
|
+
|-------|----------------|------------------|
|
|
99
|
+
| **otel** | `pip install arize[otel]` | OpenTelemetry auto-instrumentation package (arize-otel) for automatic tracing |
|
|
100
|
+
| **embeddings** | `pip install arize[embeddings]` | Automatic embedding generation for NLP, CV, and structured data (Pillow, datasets, tokenizers, torch, transformers) |
|
|
101
|
+
| **mimic** | `pip install arize[mimic]` | MIMIC explainer for model interpretability |
|
|
102
|
+
|
|
103
|
+
Install multiple extras:
|
|
91
104
|
|
|
92
105
|
```bash
|
|
93
|
-
pip install arize
|
|
106
|
+
pip install arize[otel,embeddings,mimic]
|
|
94
107
|
```
|
|
95
108
|
|
|
109
|
+
## Migrating from Version 7
|
|
110
|
+
|
|
111
|
+
If you're upgrading from version 7, please refer to the [Migration Guide](https://arize.com/docs/api-clients/python/version-8/migration) for detailed migration steps and breaking changes.
|
|
112
|
+
|
|
96
113
|
# Usage
|
|
97
114
|
|
|
98
115
|
## Instrumentation
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "arize"
|
|
3
|
+
description = "A helper library to interact with Arize AI APIs"
|
|
4
|
+
readme = "README.md"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
license = { text = "Apache-2.0" }
|
|
7
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
8
|
+
keywords = [
|
|
9
|
+
"Arize",
|
|
10
|
+
"Observability",
|
|
11
|
+
"Monitoring",
|
|
12
|
+
"Explainability",
|
|
13
|
+
"Tracing",
|
|
14
|
+
"LLM",
|
|
15
|
+
"Evaluations",
|
|
16
|
+
]
|
|
17
|
+
authors = [{ name = "Arize AI", email = "support@arize.com" }]
|
|
18
|
+
maintainers = [{ name = "Arize AI", email = "support@arize.com" }]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 3 - Alpha",
|
|
21
|
+
"Programming Language :: Python",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Intended Audience :: Developers",
|
|
28
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
29
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
30
|
+
"Topic :: System :: Logging",
|
|
31
|
+
"Topic :: System :: Monitoring",
|
|
32
|
+
]
|
|
33
|
+
dependencies = [
|
|
34
|
+
"numpy>=2.0.0",
|
|
35
|
+
"openinference-semantic-conventions>=0.1.25, <1",
|
|
36
|
+
"opentelemetry-exporter-otlp-proto-common>=1.38.0",
|
|
37
|
+
"opentelemetry-exporter-otlp-proto-grpc>=1.38.0",
|
|
38
|
+
"opentelemetry-sdk>=1.38.0",
|
|
39
|
+
"opentelemetry-semantic-conventions>=0.43b0, <1",
|
|
40
|
+
"pandas>=2.0.0, <3",
|
|
41
|
+
"protobuf>=4.21.0, <6",
|
|
42
|
+
"pyarrow>=0.15.0",
|
|
43
|
+
"pydantic>=2, <3",
|
|
44
|
+
"python-dateutil>=2.8.2, <3",
|
|
45
|
+
"requests>=2.0.0, <3",
|
|
46
|
+
"requests_futures>=1.0.0, <2",
|
|
47
|
+
"tqdm>4, <5", # For progress bars
|
|
48
|
+
"typing-extensions>=4.7.1, <5",
|
|
49
|
+
"urllib3>=2.1.0, <3",
|
|
50
|
+
"wrapt>=1.0.0, <2.0.0",
|
|
51
|
+
]
|
|
52
|
+
dynamic = ["version"]
|
|
53
|
+
|
|
54
|
+
[project.optional-dependencies]
|
|
55
|
+
dev = [
|
|
56
|
+
"mypy==1.19.1",
|
|
57
|
+
"pandas-stubs>=2.2.0",
|
|
58
|
+
"pytest-cov==6.0.0",
|
|
59
|
+
"pytest==8.4.2",
|
|
60
|
+
"ruff==0.14.9",
|
|
61
|
+
"taskipy>=1.14.1, <2",
|
|
62
|
+
"types-python-dateutil>=2.9.0",
|
|
63
|
+
"types-requests>=2.31.0",
|
|
64
|
+
"types-tabulate>=0.9.0",
|
|
65
|
+
"types-tqdm>=4.66.0",
|
|
66
|
+
]
|
|
67
|
+
otel = [
|
|
68
|
+
"arize-otel>=0.11.0, <1",
|
|
69
|
+
]
|
|
70
|
+
mimic = [
|
|
71
|
+
"interpret-community[mimic]>=0.22.0,<1",
|
|
72
|
+
]
|
|
73
|
+
embeddings = [
|
|
74
|
+
"Pillow>=8.4.0, <11",
|
|
75
|
+
"datasets>=2.8, <3, !=2.14.*",
|
|
76
|
+
"tokenizers>=0.13, <1",
|
|
77
|
+
"torch>=1.13, <3",
|
|
78
|
+
"transformers>=4.25, <5",
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
[project.urls]
|
|
82
|
+
Homepage = "https://arize.com"
|
|
83
|
+
Documentation = "https://docs.arize.com/arize"
|
|
84
|
+
Issues = "https://github.com/Arize-ai/client_python/issues"
|
|
85
|
+
Source = "https://github.com/Arize-ai/client_python"
|
|
86
|
+
Changelog = "https://github.com/Arize-ai/client_python/blob/main/CHANGELOG.md"
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
[build-system]
|
|
90
|
+
requires = ["hatchling"]
|
|
91
|
+
build-backend = "hatchling.build"
|
|
92
|
+
|
|
93
|
+
[tool.hatch.version]
|
|
94
|
+
path = "src/arize/version.py"
|
|
95
|
+
|
|
96
|
+
[tool.hatch.build]
|
|
97
|
+
only-packages = true
|
|
98
|
+
|
|
99
|
+
[tool.hatch.build.targets.wheel]
|
|
100
|
+
packages = ["src/arize"]
|
|
101
|
+
|
|
102
|
+
[tool.hatch.build.targets.sdist]
|
|
103
|
+
exclude = ["tests", "docs"]
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
[tool.black]
|
|
107
|
+
include = '\.pyi?$'
|
|
108
|
+
exclude = '(_pb2\.py$|docs/source/.*\.py)'
|
|
109
|
+
|
|
110
|
+
[tool.ruff]
|
|
111
|
+
target-version = "py310"
|
|
112
|
+
line-length = 80
|
|
113
|
+
exclude = [
|
|
114
|
+
"dist/",
|
|
115
|
+
"testing_notebooks/",
|
|
116
|
+
"__pycache__",
|
|
117
|
+
"src/arize/_generated/**/*.py",
|
|
118
|
+
"*_pb2.py*",
|
|
119
|
+
"*_pb2_grpc.py*",
|
|
120
|
+
"*.pyi",
|
|
121
|
+
"docs/",
|
|
122
|
+
]
|
|
123
|
+
[tool.ruff.format]
|
|
124
|
+
docstring-code-format = true
|
|
125
|
+
line-ending = "native"
|
|
126
|
+
|
|
127
|
+
[tool.ruff.lint]
|
|
128
|
+
select = [
|
|
129
|
+
# Core correctness & style
|
|
130
|
+
# ------------------------
|
|
131
|
+
"E", # pycodestyle errors (syntax, indentation, whitespace)
|
|
132
|
+
"W", # pycodestyle warnings (less severe style issues)
|
|
133
|
+
"F", # Pyflakes (unused imports, undefined names, etc.)
|
|
134
|
+
"UP", # pyupgrade (modernize syntax for your Python version)
|
|
135
|
+
"B", # flake8-bugbear (likely bugs and design problems)
|
|
136
|
+
"SIM", # flake8-simplify (simpler / clearer code patterns)
|
|
137
|
+
"I", # isort (import ordering)
|
|
138
|
+
|
|
139
|
+
# Typing & documentation
|
|
140
|
+
# ------------------------
|
|
141
|
+
"ANN", # flake8-annotations (enforce type annotations)
|
|
142
|
+
"D", # pydocstyle (docstring conventions for public APIs)
|
|
143
|
+
"TCH", # flake8-type-checking (TYPE_CHECKING import hygiene)
|
|
144
|
+
|
|
145
|
+
# Recommended for SDKs
|
|
146
|
+
# ------------------------
|
|
147
|
+
"RUF", # Ruff-native rules (high-signal correctness & footguns)
|
|
148
|
+
"C4", # flake8-comprehensions (cleaner comprehensions)
|
|
149
|
+
"PIE", # flake8-pie (small correctness & readability improvements)
|
|
150
|
+
"PERF", # perflint (common performance pitfalls)
|
|
151
|
+
"DTZ", # flake8-datetimez (timezone-aware datetime usage)
|
|
152
|
+
"TRY", # tryceratops (better exception handling patterns)
|
|
153
|
+
"RET", # flake8-return (return consistency)
|
|
154
|
+
"S", # flake8-bandit (basic security issues; tune via ignores)
|
|
155
|
+
]
|
|
156
|
+
ignore = [
|
|
157
|
+
"TRY003", # Put long / detailed messages inside the exception class
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
[tool.ruff.lint.per-file-ignores]
|
|
161
|
+
"tests/**/*.py" = [
|
|
162
|
+
"D104", # Missing docstring in public package
|
|
163
|
+
"DTZ001", # Allow naive datetime usage in tests
|
|
164
|
+
"S101", # Allow assert statements in tests
|
|
165
|
+
"S108", # Allow insecure usage of temporary file or directory
|
|
166
|
+
"TRY301", # Allow generic exception catching in tests
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
[tool.ruff.lint.isort]
|
|
170
|
+
force-wrap-aliases = true
|
|
171
|
+
|
|
172
|
+
[tool.ruff.lint.pycodestyle]
|
|
173
|
+
max-doc-length = 110
|
|
174
|
+
max-line-length = 110
|
|
175
|
+
|
|
176
|
+
[tool.ruff.lint.pydocstyle]
|
|
177
|
+
convention = "google"
|
|
178
|
+
|
|
179
|
+
[tool.ruff.lint.pyupgrade]
|
|
180
|
+
keep-runtime-typing = true
|
|
181
|
+
|
|
182
|
+
[tool.mypy]
|
|
183
|
+
python_version = "3.10"
|
|
184
|
+
warn_unused_configs = true
|
|
185
|
+
exclude = ["testing_notebooks/", "src/arize/_generated/", "tests/"]
|
|
186
|
+
# Incrementally enable strict type checking by uncommenting checks from bottom to top.
|
|
187
|
+
# Fix foundational issues (imports, syntax) before type definitions, then signatures, then implementations.
|
|
188
|
+
disable_error_code = []
|
|
189
|
+
|
|
190
|
+
# Ignore missing imports for libraries without type stubs
|
|
191
|
+
[[tool.mypy.overrides]]
|
|
192
|
+
module = [
|
|
193
|
+
"pyarrow.*",
|
|
194
|
+
"google.protobuf.*",
|
|
195
|
+
"wrapt.*",
|
|
196
|
+
"datasets.*",
|
|
197
|
+
"requests_futures.*",
|
|
198
|
+
"interpret_community.*",
|
|
199
|
+
"sklearn.*",
|
|
200
|
+
]
|
|
201
|
+
ignore_missing_imports = true
|
|
202
|
+
|
|
203
|
+
[tool.pytest.ini_options]
|
|
204
|
+
# Directory where pytest will search for tests
|
|
205
|
+
testpaths = ["tests"]
|
|
206
|
+
# Patterns for discovering test files (files matching these patterns will be collected)
|
|
207
|
+
python_files = ["test_*.py", "*_test.py"]
|
|
208
|
+
# Patterns for discovering test classes (classes matching this pattern will be collected)
|
|
209
|
+
python_classes = ["Test*"]
|
|
210
|
+
# Patterns for discovering test functions (functions matching this pattern will be collected)
|
|
211
|
+
python_functions = ["test_*"]
|
|
212
|
+
# Directories and patterns to ignore during test collection
|
|
213
|
+
norecursedirs = [
|
|
214
|
+
"testing_notebooks",
|
|
215
|
+
".*",
|
|
216
|
+
"build",
|
|
217
|
+
"dist",
|
|
218
|
+
"*.egg"
|
|
219
|
+
]
|
|
220
|
+
# Additional command-line options to always apply when running pytest
|
|
221
|
+
addopts = [
|
|
222
|
+
"-v", # Verbose: show individual test names as they run
|
|
223
|
+
"--strict-markers", # Error on undefined markers (prevents typos like @pytest.mark.slo instead of @pytest.mark.slow)
|
|
224
|
+
"--tb=short", # Shorter tracebacks: show only the failure point without full stack
|
|
225
|
+
"--durations=10", # Show the 10 slowest tests at the end (helps identify performance bottlenecks)
|
|
226
|
+
]
|
|
227
|
+
# Custom markers that can be used to categorize tests (use with @pytest.mark.marker_name)
|
|
228
|
+
markers = [
|
|
229
|
+
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
230
|
+
"integration: marks tests as integration tests",
|
|
231
|
+
"unit: marks tests as unit tests",
|
|
232
|
+
]
|
|
233
|
+
|
|
234
|
+
[tool.coverage.run]
|
|
235
|
+
source = ["src/arize"]
|
|
236
|
+
omit = [
|
|
237
|
+
"*/tests/*",
|
|
238
|
+
"*/testing_notebooks/*",
|
|
239
|
+
"*/_generated/*",
|
|
240
|
+
"*/__pycache__/*",
|
|
241
|
+
"*/site-packages/*",
|
|
242
|
+
# Exclude other src/arize modules. TODO(Kiko): Remove them progressively.
|
|
243
|
+
"src/arize/constants/*",
|
|
244
|
+
"src/arize/datasets/*",
|
|
245
|
+
"src/arize/embeddings/*",
|
|
246
|
+
"src/arize/exceptions/*",
|
|
247
|
+
"src/arize/experiments/*",
|
|
248
|
+
"src/arize/ml/*",
|
|
249
|
+
"src/arize/projects/*",
|
|
250
|
+
"src/arize/spans/*",
|
|
251
|
+
"src/arize/utils/*",
|
|
252
|
+
]
|
|
253
|
+
# Enable branch coverage (measures whether all branches of if/else/try/except are tested)
|
|
254
|
+
# Without this, only line coverage is measured
|
|
255
|
+
branch = true
|
|
256
|
+
|
|
257
|
+
[tool.coverage.report]
|
|
258
|
+
# Number of decimal places to show in coverage percentages (e.g., 85.47% instead of 85%)
|
|
259
|
+
precision = 2
|
|
260
|
+
# Show line numbers for lines that are missing coverage in the report
|
|
261
|
+
show_missing = true
|
|
262
|
+
# If true, files with 100% coverage would be hidden from the report
|
|
263
|
+
skip_covered = false
|
|
264
|
+
# Minimum coverage percentage required (build fails if total coverage is below this)
|
|
265
|
+
fail_under = 90
|
|
266
|
+
# Lines matching these patterns are excluded from coverage measurement
|
|
267
|
+
exclude_lines = [
|
|
268
|
+
"pragma: no cover",
|
|
269
|
+
"def __repr__",
|
|
270
|
+
"raise AssertionError",
|
|
271
|
+
"raise NotImplementedError",
|
|
272
|
+
"if __name__ == .__main__.:",
|
|
273
|
+
"if TYPE_CHECKING:",
|
|
274
|
+
"@abstractmethod",
|
|
275
|
+
"@abc.abstractmethod",
|
|
276
|
+
]
|
|
277
|
+
|
|
278
|
+
[tool.coverage.html]
|
|
279
|
+
# Directory where HTML coverage reports will be generated (browsable in a web browser)
|
|
280
|
+
directory = "htmlcov"
|
|
281
|
+
|
|
282
|
+
[tool.taskipy.tasks]
|
|
283
|
+
lint = { cmd = "ruff format . && ruff check --fix .", cwd = ".", help = "Run ruff to format and lint the package." }
|
|
284
|
+
type-check = {cmd = "mypy --no-incremental --show-traceback --config-file pyproject.toml .", cwd = ".", help = "Run mypy for type checking."}
|
|
285
|
+
test = {cmd = "pytest --cov .", cwd = ".", help = "Run the test suite with coverage."}
|
|
286
|
+
# Exclusive for CI
|
|
287
|
+
ci-format = { cmd = "ruff format --check .", cwd = ".", help = "Run ruff to check formatting of the package during CI." }
|
|
288
|
+
ci-lint = { cmd = "ruff check .", cwd = ".", help = "Run ruff to check linting rules of the package during CI." }
|
|
289
|
+
ci-type-check = {cmd = "mypy --no-incremental --show-traceback --config-file pyproject.toml .", cwd = ".", help = "Run mypy for type checking during CI."}
|
|
290
|
+
ci-test = {cmd = "pytest --cov --cov-report=term-missing --cov-report=html .", cwd = ".", help = "Run the test suite with coverage during CI."}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
from collections.abc import Mapping
|
|
5
|
+
from typing import Literal, cast
|
|
5
6
|
|
|
6
7
|
from arize._generated.api_client import models
|
|
7
8
|
from arize.client import ArizeClient
|
|
@@ -37,7 +38,7 @@ def make_to_df(field_name: str) -> object:
|
|
|
37
38
|
json_normalize: bool = False,
|
|
38
39
|
convert_dtypes: bool = True,
|
|
39
40
|
) -> object:
|
|
40
|
-
"""Convert a list of objects to a pandas
|
|
41
|
+
"""Convert a list of objects to a :class:`pandas.DataFrame`.
|
|
41
42
|
|
|
42
43
|
Behavior:
|
|
43
44
|
- If an item is a Pydantic v2 model, use `.model_dump(by_alias=...)`.
|
|
@@ -82,7 +83,11 @@ def make_to_df(field_name: str) -> object:
|
|
|
82
83
|
|
|
83
84
|
# Drop None/NaN columns if requested
|
|
84
85
|
if exclude_none in ("any", "all", True):
|
|
85
|
-
drop_how
|
|
86
|
+
drop_how: Literal["any", "all"] = (
|
|
87
|
+
"all"
|
|
88
|
+
if exclude_none is True
|
|
89
|
+
else cast("Literal['any', 'all']", exclude_none)
|
|
90
|
+
)
|
|
86
91
|
df.dropna(axis=1, how=drop_how, inplace=True)
|
|
87
92
|
|
|
88
93
|
if convert_dtypes:
|
|
@@ -92,6 +97,8 @@ def make_to_df(field_name: str) -> object:
|
|
|
92
97
|
return to_df
|
|
93
98
|
|
|
94
99
|
|
|
100
|
+
# Monkey-patch convenience methods onto generated response models
|
|
101
|
+
# Type ignore comments needed: mypy can't verify runtime attribute additions
|
|
95
102
|
models.DatasetsList200Response.to_df = make_to_df("datasets") # type: ignore[attr-defined]
|
|
96
103
|
models.DatasetsExamplesList200Response.to_df = make_to_df("examples") # type: ignore[attr-defined]
|
|
97
104
|
models.ExperimentsList200Response.to_df = make_to_df("experiments") # type: ignore[attr-defined]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Factory for creating and caching the generated OpenAPI client."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import threading
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from arize._generated.api_client.api_client import ApiClient
|
|
10
|
+
from arize.config import SDKConfiguration
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class GeneratedClientFactory:
|
|
14
|
+
"""Factory for creating and caching generated OpenAPI clients.
|
|
15
|
+
|
|
16
|
+
This factory is owned by ArizeClient and provides thread-safe lazy
|
|
17
|
+
initialization of the OpenAPI client used by various subclients.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, sdk_config: SDKConfiguration) -> None:
|
|
21
|
+
"""Initialize the factory.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
sdk_config: SDK configuration containing API settings.
|
|
25
|
+
"""
|
|
26
|
+
self._sdk_config = sdk_config
|
|
27
|
+
self._client: ApiClient | None = None
|
|
28
|
+
self._lock = threading.Lock()
|
|
29
|
+
|
|
30
|
+
def get_client(self) -> ApiClient:
|
|
31
|
+
"""Get or create the generated OpenAPI client instance.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
The shared generated API client instance.
|
|
35
|
+
"""
|
|
36
|
+
if self._client is not None:
|
|
37
|
+
return self._client
|
|
38
|
+
|
|
39
|
+
with self._lock:
|
|
40
|
+
if self._client is not None:
|
|
41
|
+
return self._client
|
|
42
|
+
|
|
43
|
+
# Import lazily to avoid extra dependencies at config time
|
|
44
|
+
from arize._generated import api_client as gen
|
|
45
|
+
|
|
46
|
+
cfg = gen.Configuration(host=self._sdk_config.api_url)
|
|
47
|
+
if self._sdk_config.api_key:
|
|
48
|
+
cfg.access_token = self._sdk_config.api_key
|
|
49
|
+
self._client = gen.ApiClient(cfg)
|
|
50
|
+
return self._client
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# type: ignore[pb2]
|
|
2
1
|
import logging
|
|
3
2
|
from dataclasses import dataclass
|
|
4
3
|
from datetime import datetime
|
|
@@ -41,7 +40,7 @@ class ArizeExportClient:
|
|
|
41
40
|
batch_id: str = "",
|
|
42
41
|
include_actuals: bool = False,
|
|
43
42
|
stream_chunk_size: int | None = None,
|
|
44
|
-
) ->
|
|
43
|
+
) -> pd.DataFrame:
|
|
45
44
|
"""Exports data of a specific model in the Arize platform to a pandas dataframe.
|
|
46
45
|
|
|
47
46
|
The export covers a defined time interval and model environment, and can
|
|
@@ -237,6 +236,22 @@ class ArizeExportClient:
|
|
|
237
236
|
columns: list | None = None,
|
|
238
237
|
stream_chunk_size: int | None = None,
|
|
239
238
|
) -> tuple[flight.FlightStreamReader | None, int]:
|
|
239
|
+
# Validate inputs first before creating logging context
|
|
240
|
+
validate_input_type(space_id, "space_id", str)
|
|
241
|
+
validate_input_type(model_id, "model_id", str)
|
|
242
|
+
validate_input_type(environment, "environment", Environments)
|
|
243
|
+
validate_input_type(include_actuals, "include_actuals", bool)
|
|
244
|
+
validate_input_type(start_time, "start_time", datetime)
|
|
245
|
+
validate_input_type(end_time, "end_time", datetime)
|
|
246
|
+
validate_input_type(model_version, "model_version", str)
|
|
247
|
+
validate_input_type(batch_id, "batch_id", str)
|
|
248
|
+
validate_input_type(where, "where", str)
|
|
249
|
+
validate_input_type(columns, "columns", list, allow_none=True)
|
|
250
|
+
validate_input_type(
|
|
251
|
+
stream_chunk_size, "stream_chunk_size", int, allow_none=True
|
|
252
|
+
)
|
|
253
|
+
validate_start_end_time(start_time, end_time)
|
|
254
|
+
|
|
240
255
|
# Bind common context for this operation
|
|
241
256
|
log = CtxAdapter(
|
|
242
257
|
logger,
|
|
@@ -258,20 +273,6 @@ class ArizeExportClient:
|
|
|
258
273
|
},
|
|
259
274
|
)
|
|
260
275
|
log.debug("Getting stream reader...")
|
|
261
|
-
validate_input_type(space_id, "space_id", str)
|
|
262
|
-
validate_input_type(model_id, "model_id", str)
|
|
263
|
-
validate_input_type(environment, "environment", Environments)
|
|
264
|
-
validate_input_type(include_actuals, "include_actuals", bool)
|
|
265
|
-
validate_input_type(start_time, "start_time", datetime)
|
|
266
|
-
validate_input_type(end_time, "end_time", datetime)
|
|
267
|
-
validate_input_type(model_version, "model_version", str)
|
|
268
|
-
validate_input_type(batch_id, "batch_id", str)
|
|
269
|
-
validate_input_type(where, "where", str)
|
|
270
|
-
validate_input_type(columns, "columns", list, allow_none=True)
|
|
271
|
-
validate_input_type(
|
|
272
|
-
stream_chunk_size, "stream_chunk_size", int, allow_none=True
|
|
273
|
-
)
|
|
274
|
-
validate_start_end_time(start_time, end_time)
|
|
275
276
|
|
|
276
277
|
# Create query descriptor
|
|
277
278
|
query_descriptor = flight_pb2.RecordQueryDescriptor(
|
|
@@ -300,7 +301,7 @@ class ArizeExportClient:
|
|
|
300
301
|
try:
|
|
301
302
|
flight_info = self.flight_client.get_flight_info(
|
|
302
303
|
flight.FlightDescriptor.for_command(
|
|
303
|
-
json_format.MessageToJson(query_descriptor)
|
|
304
|
+
json_format.MessageToJson(query_descriptor)
|
|
304
305
|
),
|
|
305
306
|
)
|
|
306
307
|
logger.info("Fetching data...")
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import Any, TypeGuard
|
|
3
5
|
|
|
4
6
|
import numpy as np
|
|
5
7
|
import pandas as pd
|
|
@@ -28,7 +30,10 @@ logger = logging.getLogger(__name__)
|
|
|
28
30
|
# of the error is on the data; It should not prevent a user from continuing to use the data
|
|
29
31
|
class OtelTracingDataTransformer:
|
|
30
32
|
def _apply_column_transformation(
|
|
31
|
-
self,
|
|
33
|
+
self,
|
|
34
|
+
df: pd.DataFrame,
|
|
35
|
+
col_name: str,
|
|
36
|
+
transform_func: Callable[[Any], Any],
|
|
32
37
|
) -> str | None:
|
|
33
38
|
"""Apply a transformation to a column and return error message if it fails."""
|
|
34
39
|
try:
|
|
@@ -89,7 +94,7 @@ class OtelTracingDataTransformer:
|
|
|
89
94
|
if col.name in df.columns
|
|
90
95
|
]
|
|
91
96
|
for col_name in dirty_string_column_names:
|
|
92
|
-
df[col_name] = df[col_name].apply(self._clean_json_string)
|
|
97
|
+
df[col_name] = df[col_name].apply(self._clean_json_string) # type: ignore[arg-type]
|
|
93
98
|
|
|
94
99
|
# Convert timestamp columns to datetime objects
|
|
95
100
|
timestamp_column_names: list[str] = [
|
|
@@ -102,7 +107,7 @@ class OtelTracingDataTransformer:
|
|
|
102
107
|
]
|
|
103
108
|
for col_name in timestamp_column_names:
|
|
104
109
|
df[col_name] = df[col_name].apply(
|
|
105
|
-
self._convert_timestamp_to_datetime
|
|
110
|
+
self._convert_timestamp_to_datetime # type: ignore[arg-type]
|
|
106
111
|
)
|
|
107
112
|
|
|
108
113
|
for err in errors:
|
|
@@ -138,7 +143,7 @@ class OtelTracingDataTransformer:
|
|
|
138
143
|
return None
|
|
139
144
|
return None
|
|
140
145
|
|
|
141
|
-
def _is_non_empty_string(self, value: object) ->
|
|
146
|
+
def _is_non_empty_string(self, value: object) -> TypeGuard[str]:
|
|
142
147
|
return isinstance(value, str) and value != ""
|
|
143
148
|
|
|
144
149
|
def _deserialize_json_string_to_dict(self, value: str) -> object:
|