acceldata-sdk-python 26.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- acceldata/__init__.py +7 -0
- acceldata/client/__init__.py +0 -0
- acceldata/client/adoc_client.py +666 -0
- acceldata/client/http_client.py +346 -0
- acceldata/client/transient_retry.py +142 -0
- acceldata/constants/__init__.py +1 -0
- acceldata/constants/constants.py +13 -0
- acceldata/exceptions/__init__.py +52 -0
- acceldata/exceptions/api_errors.py +85 -0
- acceldata/exceptions/exceptions.py +174 -0
- acceldata/exceptions/sdk_exceptions.py +98 -0
- acceldata/mappers/__init__.py +21 -0
- acceldata/mappers/catalog_executions.py +107 -0
- acceldata/models/__init__.py +0 -0
- acceldata/models/api/catalog/above_configs.py +99 -0
- acceldata/models/api/catalog/above_configs_success.py +138 -0
- acceldata/models/api/catalog/absolute_configs.py +197 -0
- acceldata/models/api/catalog/absolute_configs_fallback.py +101 -0
- acceldata/models/api/catalog/absolute_threshold_config.py +105 -0
- acceldata/models/api/catalog/analysis_job_context.py +102 -0
- acceldata/models/api/catalog/analytics_pipeline.py +385 -0
- acceldata/models/api/catalog/analytics_pipeline_endpoint.py +136 -0
- acceldata/models/api/catalog/anomaly_config.py +95 -0
- acceldata/models/api/catalog/anomaly_details.py +119 -0
- acceldata/models/api/catalog/anomaly_threshold_config.py +105 -0
- acceldata/models/api/catalog/artifact.py +92 -0
- acceldata/models/api/catalog/assembly.py +171 -0
- acceldata/models/api/catalog/asset.py +162 -0
- acceldata/models/api/catalog/asset_catalog_listing.py +159 -0
- acceldata/models/api/catalog/asset_catalog_listing_response.py +102 -0
- acceldata/models/api/catalog/asset_label_request.py +96 -0
- acceldata/models/api/catalog/asset_progress.py +96 -0
- acceldata/models/api/catalog/asset_progress_details.py +117 -0
- acceldata/models/api/catalog/asset_tag.py +124 -0
- acceldata/models/api/catalog/asset_tag_info.py +140 -0
- acceldata/models/api/catalog/asset_tag_request.py +95 -0
- acceldata/models/api/catalog/asset_tag_response.py +96 -0
- acceldata/models/api/catalog/asset_tags_response.py +102 -0
- acceldata/models/api/catalog/asset_type.py +96 -0
- acceldata/models/api/catalog/auto_anomaly_feature_analysis.py +160 -0
- acceldata/models/api/catalog/auto_anomaly_item_execution.py +133 -0
- acceldata/models/api/catalog/auto_anomaly_meta_data.py +162 -0
- acceldata/models/api/catalog/auto_anomaly_rule_execution.py +102 -0
- acceldata/models/api/catalog/auto_anomaly_summary.py +124 -0
- acceldata/models/api/catalog/backing_asset.py +126 -0
- acceldata/models/api/catalog/below_configs.py +99 -0
- acceldata/models/api/catalog/big_decimal.py +100 -0
- acceldata/models/api/catalog/big_integer.py +98 -0
- acceldata/models/api/catalog/bounds_date_time_marker_config.py +110 -0
- acceldata/models/api/catalog/bounds_file_event_marker_config.py +108 -0
- acceldata/models/api/catalog/bounds_id_marker_config.py +96 -0
- acceldata/models/api/catalog/catalog_asset_meta_data.py +128 -0
- acceldata/models/api/catalog/changes_by_config.py +105 -0
- acceldata/models/api/catalog/column_mapping.py +139 -0
- acceldata/models/api/catalog/column_metadata.py +90 -0
- acceldata/models/api/catalog/column_metric_with_anomaly_details.py +119 -0
- acceldata/models/api/catalog/column_variable.py +111 -0
- acceldata/models/api/catalog/composite_policy_execution.py +102 -0
- acceldata/models/api/catalog/composite_policy_item_execution.py +104 -0
- acceldata/models/api/catalog/connection.py +118 -0
- acceldata/models/api/catalog/connection_test_result.py +106 -0
- acceldata/models/api/catalog/connection_type.py +90 -0
- acceldata/models/api/catalog/connection_types_response.py +96 -0
- acceldata/models/api/catalog/crawler.py +88 -0
- acceldata/models/api/catalog/crawler_action_response.py +90 -0
- acceldata/models/api/catalog/crawler_execution.py +147 -0
- acceldata/models/api/catalog/crawler_execution_response.py +102 -0
- acceldata/models/api/catalog/crawler_status_response.py +90 -0
- acceldata/models/api/catalog/create_profile.py +194 -0
- acceldata/models/api/catalog/custom_sql_config.py +121 -0
- acceldata/models/api/catalog/data_bricks_spark_resource_config.py +104 -0
- acceldata/models/api/catalog/data_cadence_rule.py +236 -0
- acceldata/models/api/catalog/data_cadence_rule_details.py +125 -0
- acceldata/models/api/catalog/data_cadence_rule_execution.py +102 -0
- acceldata/models/api/catalog/data_cadence_rule_item.py +104 -0
- acceldata/models/api/catalog/data_cadence_rule_item_execution.py +158 -0
- acceldata/models/api/catalog/data_cadence_rule_response.py +98 -0
- acceldata/models/api/catalog/data_drift_execution.py +102 -0
- acceldata/models/api/catalog/data_drift_item_execution.py +121 -0
- acceldata/models/api/catalog/data_quality_engine.py +90 -0
- acceldata/models/api/catalog/data_quality_execution.py +106 -0
- acceldata/models/api/catalog/data_quality_rule.py +323 -0
- acceldata/models/api/catalog/data_quality_rule_details.py +186 -0
- acceldata/models/api/catalog/data_quality_rule_response.py +120 -0
- acceldata/models/api/catalog/data_quality_rules_response.py +102 -0
- acceldata/models/api/catalog/databricks_compute_config.py +113 -0
- acceldata/models/api/catalog/dataplane_engine.py +105 -0
- acceldata/models/api/catalog/dataplane_health_metrics.py +101 -0
- acceldata/models/api/catalog/dataplane_job.py +216 -0
- acceldata/models/api/catalog/dataplane_job_status.py +113 -0
- acceldata/models/api/catalog/dataplane_request.py +96 -0
- acceldata/models/api/catalog/dataproc_compute_config.py +106 -0
- acceldata/models/api/catalog/dataproc_spark_resource_config.py +104 -0
- acceldata/models/api/catalog/date_based_partition_marker_config.py +116 -0
- acceldata/models/api/catalog/date_partitioning_marker_config.py +113 -0
- acceldata/models/api/catalog/date_time_marker_config.py +109 -0
- acceldata/models/api/catalog/day_month_year_based_partition_marker_config.py +124 -0
- acceldata/models/api/catalog/decreased_by_config.py +105 -0
- acceldata/models/api/catalog/delete_artifact_response.py +88 -0
- acceldata/models/api/catalog/dq_rule_execution.py +248 -0
- acceldata/models/api/catalog/drift.py +121 -0
- acceldata/models/api/catalog/enable_rule_request.py +88 -0
- acceldata/models/api/catalog/engine.py +90 -0
- acceldata/models/api/catalog/execution_cancellation_response.py +92 -0
- acceldata/models/api/catalog/execution_response.py +144 -0
- acceldata/models/api/catalog/execution_result.py +126 -0
- acceldata/models/api/catalog/executions_response.py +102 -0
- acceldata/models/api/catalog/failed_asset_detail.py +90 -0
- acceldata/models/api/catalog/failed_summary.py +98 -0
- acceldata/models/api/catalog/file.py +94 -0
- acceldata/models/api/catalog/file_marker_config.py +99 -0
- acceldata/models/api/catalog/generic_config_fallback.py +101 -0
- acceldata/models/api/catalog/generic_execution.py +221 -0
- acceldata/models/api/catalog/generic_rule_execution.py +137 -0
- acceldata/models/api/catalog/global_storage_config_dto.py +172 -0
- acceldata/models/api/catalog/hosted_dp_deployment_response.py +98 -0
- acceldata/models/api/catalog/id_marker_config.py +94 -0
- acceldata/models/api/catalog/increased_by_config.py +105 -0
- acceldata/models/api/catalog/item.py +160 -0
- acceldata/models/api/catalog/item_execution.py +192 -0
- acceldata/models/api/catalog/item_segment.py +131 -0
- acceldata/models/api/catalog/job_schedule.py +118 -0
- acceldata/models/api/catalog/job_spec.py +96 -0
- acceldata/models/api/catalog/kubernetes_metrics.py +91 -0
- acceldata/models/api/catalog/label.py +97 -0
- acceldata/models/api/catalog/livy_compute_config.py +103 -0
- acceldata/models/api/catalog/livy_spark_resource_config.py +106 -0
- acceldata/models/api/catalog/look_back_config.py +90 -0
- acceldata/models/api/catalog/manual_tag_request.py +92 -0
- acceldata/models/api/catalog/mapping.py +97 -0
- acceldata/models/api/catalog/marker.py +88 -0
- acceldata/models/api/catalog/marker_config.py +349 -0
- acceldata/models/api/catalog/marker_config_fallback.py +101 -0
- acceldata/models/api/catalog/meta.py +92 -0
- acceldata/models/api/catalog/meta_data.py +92 -0
- acceldata/models/api/catalog/meta_data_item.py +94 -0
- acceldata/models/api/catalog/mini_profile_request.py +112 -0
- acceldata/models/api/catalog/notification_payload.py +114 -0
- acceldata/models/api/catalog/offset_based_marker_config.py +97 -0
- acceldata/models/api/catalog/operational_config.py +92 -0
- acceldata/models/api/catalog/pattern_configuration.py +90 -0
- acceldata/models/api/catalog/pipe_line_request.py +92 -0
- acceldata/models/api/catalog/pipeline_compute_config.py +110 -0
- acceldata/models/api/catalog/policy_execution_marker_config.py +94 -0
- acceldata/models/api/catalog/policy_execution_request.py +229 -0
- acceldata/models/api/catalog/policy_group.py +114 -0
- acceldata/models/api/catalog/policy_transform_udf.py +113 -0
- acceldata/models/api/catalog/process_metrics.py +91 -0
- acceldata/models/api/catalog/profile_anomaly_details_response.py +109 -0
- acceldata/models/api/catalog/profile_anomaly_item_execution.py +127 -0
- acceldata/models/api/catalog/profile_anomaly_rule_execution.py +102 -0
- acceldata/models/api/catalog/profile_anomaly_rule_item.py +109 -0
- acceldata/models/api/catalog/profile_cancellation_response.py +92 -0
- acceldata/models/api/catalog/profile_request.py +211 -0
- acceldata/models/api/catalog/profile_request_response.py +92 -0
- acceldata/models/api/catalog/property_template.py +178 -0
- acceldata/models/api/catalog/property_templates.py +123 -0
- acceldata/models/api/catalog/pub_sub_lookback_marker_config.py +96 -0
- acceldata/models/api/catalog/pub_sub_timestamp_marker_config.py +108 -0
- acceldata/models/api/catalog/quality_rule.py +381 -0
- acceldata/models/api/catalog/quality_rule_execution_metrics.py +114 -0
- acceldata/models/api/catalog/quality_rule_with_latest_execution.py +115 -0
- acceldata/models/api/catalog/range_configs.py +109 -0
- acceldata/models/api/catalog/reconciliation_item.py +102 -0
- acceldata/models/api/catalog/reconciliation_item_execution.py +157 -0
- acceldata/models/api/catalog/reconciliation_rule.py +339 -0
- acceldata/models/api/catalog/reconciliation_rule_details.py +225 -0
- acceldata/models/api/catalog/reconciliation_rule_execution.py +102 -0
- acceldata/models/api/catalog/reconciliation_rule_response.py +98 -0
- acceldata/models/api/catalog/reconciliation_rules_response.py +102 -0
- acceldata/models/api/catalog/relative_config.py +197 -0
- acceldata/models/api/catalog/relative_config_fallback.py +101 -0
- acceldata/models/api/catalog/relative_threshold_config.py +111 -0
- acceldata/models/api/catalog/root_cause_analysis.py +108 -0
- acceldata/models/api/catalog/rule_execution.py +327 -0
- acceldata/models/api/catalog/rule_execution_result.py +90 -0
- acceldata/models/api/catalog/rule_item_result.py +125 -0
- acceldata/models/api/catalog/rule_meta_data.py +94 -0
- acceldata/models/api/catalog/rule_spark_sql_dynamic_filter_variable_mapping.py +100 -0
- acceldata/models/api/catalog/rule_tag.py +101 -0
- acceldata/models/api/catalog/rule_threshold_configuration.py +236 -0
- acceldata/models/api/catalog/rule_threshold_configuration_fallback.py +101 -0
- acceldata/models/api/catalog/rules_with_latest_execution_response.py +102 -0
- acceldata/models/api/catalog/sample_data_api_response.py +122 -0
- acceldata/models/api/catalog/schema_drift_item_execution.py +131 -0
- acceldata/models/api/catalog/schema_drift_rule_execution.py +102 -0
- acceldata/models/api/catalog/secret_manager_configuration.py +90 -0
- acceldata/models/api/catalog/secret_manager_configuration_with_option.py +98 -0
- acceldata/models/api/catalog/security_config.py +90 -0
- acceldata/models/api/catalog/segment_metric_json.py +142 -0
- acceldata/models/api/catalog/segments_analysis.py +145 -0
- acceldata/models/api/catalog/short_segment.py +97 -0
- acceldata/models/api/catalog/simple_quality_rule_response.py +92 -0
- acceldata/models/api/catalog/snapshot_data.py +117 -0
- acceldata/models/api/catalog/source_model.py +90 -0
- acceldata/models/api/catalog/source_type.py +100 -0
- acceldata/models/api/catalog/source_types_response.py +102 -0
- acceldata/models/api/catalog/spark_job_status.py +113 -0
- acceldata/models/api/catalog/spark_resource_config.py +114 -0
- acceldata/models/api/catalog/standard_response_assembly.py +92 -0
- acceldata/models/api/catalog/standard_response_crawler_action_response.py +92 -0
- acceldata/models/api/catalog/standard_response_crawler_status_response.py +92 -0
- acceldata/models/api/catalog/standard_response_delete_artifact_response.py +92 -0
- acceldata/models/api/catalog/standard_response_list.py +96 -0
- acceldata/models/api/catalog/standard_response_map.py +88 -0
- acceldata/models/api/catalog/standard_response_meta_data.py +92 -0
- acceldata/models/api/catalog/standard_response_mini_profile_request.py +92 -0
- acceldata/models/api/catalog/standard_response_profile_request.py +92 -0
- acceldata/models/api/catalog/start_profiling_request.py +92 -0
- acceldata/models/api/catalog/tag_domain.py +116 -0
- acceldata/models/api/catalog/threshold_breach_details.py +101 -0
- acceldata/models/api/catalog/time_based_config.py +92 -0
- acceldata/models/api/catalog/time_based_threshold_config.py +105 -0
- acceldata/models/api/catalog/timestamp_based_marker_config.py +115 -0
- acceldata/models/api/catalog/udf_variable.py +97 -0
- acceldata/models/api/catalog/yunikorn_compute_config.py +133 -0
- acceldata/models/api/catalog/yunikorn_spark_resource_config.py +154 -0
- acceldata/models/api/pipeline/big_decimal.py +100 -0
- acceldata/models/api/pipeline/big_integer.py +98 -0
- acceldata/models/api/pipeline/child_span_response.py +96 -0
- acceldata/models/api/pipeline/create_span_event.py +109 -0
- acceldata/models/api/pipeline/edge.py +108 -0
- acceldata/models/api/pipeline/event_alert_object.py +95 -0
- acceldata/models/api/pipeline/generic_config_fallback.py +101 -0
- acceldata/models/api/pipeline/identifier.py +146 -0
- acceldata/models/api/pipeline/job_request.py +130 -0
- acceldata/models/api/pipeline/meta.py +107 -0
- acceldata/models/api/pipeline/meta_data.py +92 -0
- acceldata/models/api/pipeline/metric.py +103 -0
- acceldata/models/api/pipeline/node.py +201 -0
- acceldata/models/api/pipeline/node_response.py +92 -0
- acceldata/models/api/pipeline/notification_payload.py +114 -0
- acceldata/models/api/pipeline/pipeline.py +152 -0
- acceldata/models/api/pipeline/pipeline_baseline_metric.py +92 -0
- acceldata/models/api/pipeline/pipeline_details.py +118 -0
- acceldata/models/api/pipeline/pipeline_details_response.py +102 -0
- acceldata/models/api/pipeline/pipeline_input_request.py +92 -0
- acceldata/models/api/pipeline/pipeline_listing_info.py +118 -0
- acceldata/models/api/pipeline/pipeline_response.py +92 -0
- acceldata/models/api/pipeline/pipeline_run.py +136 -0
- acceldata/models/api/pipeline/pipeline_run_request.py +92 -0
- acceldata/models/api/pipeline/pipeline_runs_response.py +102 -0
- acceldata/models/api/pipeline/pipeline_summary.py +98 -0
- acceldata/models/api/pipeline/pipelines_listing_response.py +102 -0
- acceldata/models/api/pipeline/policy_summary.py +102 -0
- acceldata/models/api/pipeline/span.py +115 -0
- acceldata/models/api/pipeline/span_event.py +114 -0
- acceldata/models/api/pipeline/span_event_request.py +92 -0
- acceldata/models/api/pipeline/span_event_response.py +92 -0
- acceldata/models/api/pipeline/span_request.py +94 -0
- acceldata/models/api/pipeline/spans_response.py +96 -0
- acceldata/models/api/pipeline/tag.py +97 -0
- acceldata/models/sdk/__init__.py +0 -0
- acceldata/models/sdk/catalog/__init__.py +105 -0
- acceldata/models/sdk/catalog/asset_resource.py +112 -0
- acceldata/models/sdk/catalog/asset_source_type.py +59 -0
- acceldata/models/sdk/catalog/custom_asset_metadata.py +11 -0
- acceldata/models/sdk/catalog/datasource_resource.py +88 -0
- acceldata/models/sdk/catalog/executor.py +524 -0
- acceldata/models/sdk/catalog/policy_execution_request.py +114 -0
- acceldata/models/sdk/catalog/policy_execution_type.py +16 -0
- acceldata/models/sdk/catalog/policy_filter.py +94 -0
- acceldata/models/sdk/catalog/policy_rule_resources.py +388 -0
- acceldata/models/sdk/catalog/profile_request_resource.py +77 -0
- acceldata/models/sdk/catalog/profiling.py +82 -0
- acceldata/models/sdk/catalog/profiling_configuration_error.py +5 -0
- acceldata/models/sdk/pipeline/__init__.py +62 -0
- acceldata/models/sdk/pipeline/create_job_input.py +108 -0
- acceldata/models/sdk/pipeline/create_pipeline_input_request.py +72 -0
- acceldata/models/sdk/pipeline/events/__init__.py +5 -0
- acceldata/models/sdk/pipeline/events/generic_event.py +31 -0
- acceldata/models/sdk/pipeline/events/log_event.py +34 -0
- acceldata/models/sdk/pipeline/events/span_event.py +8 -0
- acceldata/models/sdk/pipeline/pipeline_resource.py +171 -0
- acceldata/models/sdk/pipeline/pipeline_run_input.py +84 -0
- acceldata/models/sdk/pipeline/pipeline_run_resource.py +208 -0
- acceldata/models/sdk/pipeline/pipeline_source_type.py +20 -0
- acceldata/models/sdk/pipeline/span_resource.py +327 -0
- acceldata/openapi_deserialization_patches.py +161 -0
- acceldata/openapi_repr_patches.py +62 -0
- acceldata/services/__init__.py +0 -0
- acceldata/services/api_timestamp.py +31 -0
- acceldata/services/asset_service.py +651 -0
- acceldata/services/datasource_service.py +120 -0
- acceldata/services/generic_service.py +132 -0
- acceldata/services/marker_config.py +232 -0
- acceldata/services/pipeline_big_decimal_api.py +102 -0
- acceldata/services/pipeline_response_parse.py +209 -0
- acceldata/services/pipeline_service.py +494 -0
- acceldata/services/rule_service.py +620 -0
- acceldata/urls/__init__.py +1 -0
- acceldata/urls/catalog_urls.py +137 -0
- acceldata/urls/pipeline_urls.py +55 -0
- acceldata/utils/__init__.py +6 -0
- acceldata/utils/datetime_utils.py +16 -0
- acceldata/utils/operation_ack.py +22 -0
- acceldata/utils/span_helpers.py +95 -0
- acceldata/utils/time_range_utils.py +90 -0
- acceldata_sdk_python-26.7.0.dist-info/METADATA +26 -0
- acceldata_sdk_python-26.7.0.dist-info/RECORD +303 -0
- acceldata_sdk_python-26.7.0.dist-info/WHEEL +5 -0
- acceldata_sdk_python-26.7.0.dist-info/licenses/LICENSE +22 -0
- acceldata_sdk_python-26.7.0.dist-info/top_level.txt +1 -0
acceldata/__init__.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""Acceldata Python SDK package."""
|
|
2
|
+
|
|
3
|
+
from acceldata.openapi_deserialization_patches import apply_openapi_deserialization_patches
|
|
4
|
+
from acceldata.openapi_repr_patches import apply_openapi_repr_patches
|
|
5
|
+
|
|
6
|
+
apply_openapi_repr_patches()
|
|
7
|
+
apply_openapi_deserialization_patches()
|
|
File without changes
|
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Mapping, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import JsonValue
|
|
6
|
+
|
|
7
|
+
from acceldata.client.http_client import BaseHttpClient
|
|
8
|
+
from acceldata.client.transient_retry import RetryConfig, effective_transient_retry
|
|
9
|
+
from acceldata.constants import (
|
|
10
|
+
CONNECTION_TIMEOUT_MS,
|
|
11
|
+
READ_TIMEOUT_MS,
|
|
12
|
+
)
|
|
13
|
+
from acceldata.exceptions import InvalidPolicyTypeError
|
|
14
|
+
from acceldata.models.api.catalog.assembly import Assembly
|
|
15
|
+
from acceldata.models.api.catalog.asset import Asset
|
|
16
|
+
from acceldata.models.api.catalog.asset_label_request import AssetLabelRequest
|
|
17
|
+
from acceldata.models.api.catalog.asset_tag_info import AssetTagInfo
|
|
18
|
+
from acceldata.models.api.catalog.asset_tag_request import AssetTagRequest
|
|
19
|
+
from acceldata.models.api.catalog.asset_type import AssetType
|
|
20
|
+
from acceldata.models.api.catalog.label import Label
|
|
21
|
+
from acceldata.models.api.catalog.catalog_asset_meta_data import CatalogAssetMetaData
|
|
22
|
+
from acceldata.models.api.catalog.crawler_action_response import CrawlerActionResponse
|
|
23
|
+
from acceldata.models.api.catalog.data_cadence_rule_execution import DataCadenceRuleExecution
|
|
24
|
+
from acceldata.models.api.catalog.data_cadence_rule_response import DataCadenceRuleResponse
|
|
25
|
+
from acceldata.models.api.catalog.data_quality_execution import DataQualityExecution
|
|
26
|
+
from acceldata.models.api.catalog.data_quality_rule_response import DataQualityRuleResponse
|
|
27
|
+
from acceldata.models.api.catalog.execution_cancellation_response import ExecutionCancellationResponse
|
|
28
|
+
from acceldata.models.api.catalog.execution_result import ExecutionResult
|
|
29
|
+
from acceldata.models.api.catalog.generic_execution import GenericExecution
|
|
30
|
+
from acceldata.models.api.catalog.profile_request import ProfileRequest
|
|
31
|
+
from acceldata.models.api.catalog.quality_rule import QualityRule
|
|
32
|
+
from acceldata.models.api.catalog.reconciliation_rule_execution import ReconciliationRuleExecution
|
|
33
|
+
from acceldata.models.api.catalog.reconciliation_rule_response import ReconciliationRuleResponse
|
|
34
|
+
from acceldata.models.api.catalog.rules_with_latest_execution_response import (
|
|
35
|
+
RulesWithLatestExecutionResponse,
|
|
36
|
+
)
|
|
37
|
+
from acceldata.models.api.catalog.sample_data_api_response import SampleDataApiResponse
|
|
38
|
+
from acceldata.models.api.pipeline.pipeline import Pipeline
|
|
39
|
+
from acceldata.models.api.pipeline.pipeline_runs_response import PipelineRunsResponse
|
|
40
|
+
from acceldata.models.api.pipeline.pipelines_listing_response import PipelinesListingResponse
|
|
41
|
+
from acceldata.models.api.pipeline.span_event import SpanEvent
|
|
42
|
+
from acceldata.models.api.pipeline.span_event_request import SpanEventRequest
|
|
43
|
+
from acceldata.models.api.pipeline.spans_response import SpansResponse
|
|
44
|
+
from acceldata.models.api.pipeline.tag import Tag
|
|
45
|
+
from acceldata.models.sdk.catalog.asset_resource import AssetResource
|
|
46
|
+
from acceldata.models.sdk.catalog.asset_source_type import AssetSourceType
|
|
47
|
+
from acceldata.models.sdk.catalog.datasource_resource import DatasourceResource
|
|
48
|
+
from acceldata.models.sdk.catalog.executor import (
|
|
49
|
+
POLICY_POLL_UNLIMITED_RETRIES,
|
|
50
|
+
Executor,
|
|
51
|
+
FailureStrategy,
|
|
52
|
+
get_result_callable_for_policy_polling,
|
|
53
|
+
policy_execution_result_via_poll,
|
|
54
|
+
policy_execution_status_via_result,
|
|
55
|
+
)
|
|
56
|
+
from acceldata.models.sdk.catalog.policy_execution_request import (
|
|
57
|
+
PolicyExecutionRequestInput,
|
|
58
|
+
policy_request_with_pipeline_run_id,
|
|
59
|
+
)
|
|
60
|
+
from acceldata.models.sdk.catalog.policy_filter import PolicyFilter, PolicyType, RuleExecutionStatus, RuleType
|
|
61
|
+
from acceldata.models.sdk.catalog.policy_rule_resources import (
|
|
62
|
+
DataCadenceRuleResource,
|
|
63
|
+
DataQualityRuleResource,
|
|
64
|
+
ReconciliationRuleResource,
|
|
65
|
+
)
|
|
66
|
+
from acceldata.models.sdk.catalog.profile_request_resource import (
|
|
67
|
+
ProfileRequestResource,
|
|
68
|
+
ProfileResource,
|
|
69
|
+
)
|
|
70
|
+
from acceldata.models.sdk.catalog.profiling import AssetProfilingParams
|
|
71
|
+
from acceldata.models.sdk.pipeline.create_pipeline_input_request import CreatePipelineInputRequest
|
|
72
|
+
from acceldata.models.sdk.pipeline.pipeline_resource import PipelineResource
|
|
73
|
+
from acceldata.models.sdk.pipeline.pipeline_run_resource import PipelineRunResource
|
|
74
|
+
from acceldata.models.sdk.pipeline.span_resource import SpanResource, wrap_fetched_span
|
|
75
|
+
from acceldata.services.asset_service import AssetService
|
|
76
|
+
from acceldata.services.datasource_service import DataSourceService
|
|
77
|
+
from acceldata.services.generic_service import GenericService
|
|
78
|
+
from acceldata.services.pipeline_service import PipelineService
|
|
79
|
+
from acceldata.services.rule_service import RuleService
|
|
80
|
+
|
|
81
|
+
class AdocClient:
|
|
82
|
+
def __init__(
|
|
83
|
+
self,
|
|
84
|
+
url: str,
|
|
85
|
+
access_key: str,
|
|
86
|
+
secret_key: str,
|
|
87
|
+
connection_timeout_ms: int = CONNECTION_TIMEOUT_MS,
|
|
88
|
+
read_timeout_ms: int = READ_TIMEOUT_MS,
|
|
89
|
+
verify_ssl: bool | str = True,
|
|
90
|
+
) -> None:
|
|
91
|
+
"""Create a client and wire catalog, pipeline, and related services over HTTP.
|
|
92
|
+
|
|
93
|
+
``url`` is normalized (trailing slashes removed) and combined with API path
|
|
94
|
+
prefixes inside :class:`~acceldata.client.http_client.BaseHttpClient`.
|
|
95
|
+
``access_key`` and ``secret_key`` are sent on each request; empty credentials
|
|
96
|
+
raise ``ValueError`` from the HTTP client.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
url: Base URL of your ADOC deployment (scheme and host; may include extra
|
|
100
|
+
path segments before API prefixes when applicable).
|
|
101
|
+
access_key: ADOC API access key.
|
|
102
|
+
secret_key: ADOC API secret key.
|
|
103
|
+
connection_timeout_ms: Time in milliseconds to wait while establishing
|
|
104
|
+
the TCP connection. Default ``5000`` (same as
|
|
105
|
+
:data:`~acceldata.constants.CONNECTION_TIMEOUT_MS`). ``None`` or ``0``
|
|
106
|
+
also resolves to that default.
|
|
107
|
+
read_timeout_ms: Time in milliseconds to wait for response data after the
|
|
108
|
+
connection is established. Default ``15000`` (same as
|
|
109
|
+
:data:`~acceldata.constants.READ_TIMEOUT_MS`). ``None`` or ``0`` also
|
|
110
|
+
resolves to that default.
|
|
111
|
+
verify_ssl: TLS certificate verification behavior passed to `requests`.
|
|
112
|
+
Use `True` (default) for standard certificate validation, `False` for
|
|
113
|
+
insecure mode, or a CA bundle path string for private CAs.
|
|
114
|
+
"""
|
|
115
|
+
self._http_client: BaseHttpClient = BaseHttpClient(
|
|
116
|
+
url=url,
|
|
117
|
+
access_key=access_key,
|
|
118
|
+
secret_key=secret_key,
|
|
119
|
+
connection_timeout_ms=connection_timeout_ms,
|
|
120
|
+
read_timeout_ms=read_timeout_ms,
|
|
121
|
+
verify_ssl=verify_ssl,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
self.asset_service: AssetService = AssetService(self._http_client)
|
|
125
|
+
self.pipeline_service: PipelineService = PipelineService(self._http_client)
|
|
126
|
+
self.datasource_service: DataSourceService = DataSourceService(self._http_client)
|
|
127
|
+
self.generic_service: GenericService = GenericService(self._http_client)
|
|
128
|
+
self.rule_service: RuleService = RuleService(self._http_client)
|
|
129
|
+
|
|
130
|
+
def create_pipeline(self, create_pipeline_input_request: Optional[CreatePipelineInputRequest]) -> PipelineResource:
|
|
131
|
+
"""Create a pipeline (PUT ``/pipelines``).
|
|
132
|
+
|
|
133
|
+
Returns a :class:`~acceldata.models.sdk.pipeline.pipeline_resource.PipelineResource`
|
|
134
|
+
so you can chain operations (for example :meth:`PipelineResource.create_pipeline_run`,
|
|
135
|
+
which returns :class:`~acceldata.models.sdk.pipeline.pipeline_run_resource.PipelineRunResource`).
|
|
136
|
+
"""
|
|
137
|
+
response = self.pipeline_service.create_pipeline(create_pipeline_input_request)
|
|
138
|
+
return PipelineResource.from_response(response, self.pipeline_service)
|
|
139
|
+
|
|
140
|
+
def get_pipeline(self, pipeline_identity: str) -> PipelineResource:
|
|
141
|
+
response = self.pipeline_service.get_pipeline(pipeline_identity)
|
|
142
|
+
return PipelineResource.from_response(response, self.pipeline_service)
|
|
143
|
+
|
|
144
|
+
def get_pipeline_res(self, pipeline_identity: str) -> PipelineResource:
|
|
145
|
+
"""Backward-compatible alias for :meth:`get_pipeline`."""
|
|
146
|
+
return self.get_pipeline(pipeline_identity)
|
|
147
|
+
|
|
148
|
+
def delete_pipeline(self, pipeline_id: int):
|
|
149
|
+
response = self.pipeline_service.delete_pipeline(pipeline_id)
|
|
150
|
+
return response
|
|
151
|
+
|
|
152
|
+
def update_pipeline(self, pipeline: Pipeline) -> PipelineResource:
|
|
153
|
+
"""PUT ``/pipelines`` with a full :class:`~acceldata.models.api.pipeline.pipeline.Pipeline` (include ``id``)."""
|
|
154
|
+
response = self.pipeline_service.update_pipeline(pipeline)
|
|
155
|
+
return PipelineResource.from_response(response, self.pipeline_service)
|
|
156
|
+
|
|
157
|
+
def replace_pipeline_tags(self, pipeline_identity: str | int, tags: list[Tag]) -> PipelineResource:
|
|
158
|
+
"""GET pipeline by identity, replace ``tags``, PUT the full pipeline back."""
|
|
159
|
+
response = self.pipeline_service.replace_pipeline_tags(pipeline_identity, tags)
|
|
160
|
+
return PipelineResource.from_response(response, self.pipeline_service)
|
|
161
|
+
|
|
162
|
+
def pipeline_resource(self, pipeline: Pipeline) -> PipelineResource:
|
|
163
|
+
"""Return a :class:`~acceldata.models.sdk.pipeline.pipeline_resource.PipelineResource` for API calls."""
|
|
164
|
+
return PipelineResource(pipeline, self.pipeline_service)
|
|
165
|
+
|
|
166
|
+
def get_pipelines(self) -> PipelinesListingResponse:
|
|
167
|
+
response = self.pipeline_service.get_pipelines()
|
|
168
|
+
return response
|
|
169
|
+
|
|
170
|
+
def get_pipeline_run(
|
|
171
|
+
self,
|
|
172
|
+
*,
|
|
173
|
+
pipeline_run_id: Optional[int] = None,
|
|
174
|
+
continuation_id: Optional[str] = None,
|
|
175
|
+
pipeline_id: Optional[int] = None,
|
|
176
|
+
) -> PipelineRunResource:
|
|
177
|
+
"""Load a pipeline run by id, or by ``continuation_id`` and ``pipeline_id`` together."""
|
|
178
|
+
run = self.pipeline_service.get_pipeline_run(
|
|
179
|
+
pipeline_run_id=pipeline_run_id,
|
|
180
|
+
continuation_id=continuation_id,
|
|
181
|
+
pipeline_id=pipeline_id,
|
|
182
|
+
)
|
|
183
|
+
return PipelineRunResource(run, self.pipeline_service)
|
|
184
|
+
|
|
185
|
+
def get_pipeline_runs(self, pipeline_id: int) -> PipelineRunsResponse:
|
|
186
|
+
"""List runs for a pipeline."""
|
|
187
|
+
return self.pipeline_service.get_pipeline_runs(pipeline_id)
|
|
188
|
+
|
|
189
|
+
def get_root_span(self, pipeline_run_id: int) -> Optional[SpanResource]:
|
|
190
|
+
"""Return a :class:`~acceldata.models.sdk.pipeline.span_resource.SpanResource` for the root span, or ``None``."""
|
|
191
|
+
return self.pipeline_service.get_root_span(pipeline_run_id)
|
|
192
|
+
|
|
193
|
+
def get_span(self, pipeline_run_id: int, span_identity: str) -> SpanResource:
|
|
194
|
+
"""GET a span by uid for ``pipeline_run_id``; returns :class:`~acceldata.models.sdk.pipeline.span_resource.SpanResource`."""
|
|
195
|
+
s = self.pipeline_service.get_span(pipeline_run_id, span_identity=span_identity)
|
|
196
|
+
return wrap_fetched_span(self.pipeline_service, s)
|
|
197
|
+
|
|
198
|
+
def create_span(
|
|
199
|
+
self,
|
|
200
|
+
pipeline_run_id: int,
|
|
201
|
+
span: dict[str, JsonValue],
|
|
202
|
+
) -> SpanResource:
|
|
203
|
+
"""POST ``/pipelines/runs/{pipeline_run_id}/spans`` — create a span (root or child)."""
|
|
204
|
+
res = self.pipeline_service.create_span(pipeline_run_id, span)
|
|
205
|
+
return wrap_fetched_span(self.pipeline_service, res)
|
|
206
|
+
|
|
207
|
+
def get_child_spans(self, span_id: int) -> list[SpanResource]:
|
|
208
|
+
"""GET ``/pipelines/spans/{span_id}/childSpans`` — list child spans as resources."""
|
|
209
|
+
spans = self.pipeline_service.get_child_spans(span_id)
|
|
210
|
+
return [wrap_fetched_span(self.pipeline_service, s) for s in spans]
|
|
211
|
+
|
|
212
|
+
def get_spans(self, pipeline_run_id: int) -> SpansResponse:
|
|
213
|
+
"""List spans for a run."""
|
|
214
|
+
return self.pipeline_service.get_spans(pipeline_run_id)
|
|
215
|
+
|
|
216
|
+
def create_span_event(self, request: SpanEventRequest) -> SpanEvent:
|
|
217
|
+
"""POST ``/pipelines/spans/{span_id}/events`` — append a span event; returns :class:`SpanEvent`."""
|
|
218
|
+
return self.pipeline_service.create_span_event(request)
|
|
219
|
+
|
|
220
|
+
def get_crawler_status(
|
|
221
|
+
self,
|
|
222
|
+
datasource_name: str,
|
|
223
|
+
*,
|
|
224
|
+
transient_retry: RetryConfig | None = None,
|
|
225
|
+
):
|
|
226
|
+
return self.datasource_service.get_crawler_status(
|
|
227
|
+
datasource_name, transient_retry=transient_retry
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
def get_datasource(
|
|
231
|
+
self,
|
|
232
|
+
assembly_identifier: Any,
|
|
233
|
+
*,
|
|
234
|
+
properties: bool = False,
|
|
235
|
+
) -> DatasourceResource:
|
|
236
|
+
"""Load one datasource by name or numeric id; returns a :class:`~acceldata.models.sdk.catalog.datasource_resource.DatasourceResource`."""
|
|
237
|
+
return self.datasource_service.get_datasource(
|
|
238
|
+
assembly_identifier, properties=properties
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
def get_datasources(
|
|
242
|
+
self,
|
|
243
|
+
source_type: AssetSourceType | None = None,
|
|
244
|
+
) -> list[DatasourceResource]:
|
|
245
|
+
"""List datasources, optionally filtered by catalog source type."""
|
|
246
|
+
return self.datasource_service.get_datasources(source_type)
|
|
247
|
+
|
|
248
|
+
def get_datasource_by_id(self, id: int, *, properties: bool = False) -> DatasourceResource:
|
|
249
|
+
"""Load one datasource by numeric id."""
|
|
250
|
+
return self.get_datasource(id, properties=properties)
|
|
251
|
+
|
|
252
|
+
def get_all_datasources(self) -> list[DatasourceResource]:
|
|
253
|
+
"""List all datasources with no type filter."""
|
|
254
|
+
return self.get_datasources()
|
|
255
|
+
|
|
256
|
+
def datasource_resource(self, assembly: Assembly | DatasourceResource) -> DatasourceResource:
|
|
257
|
+
"""Build a :class:`~acceldata.models.sdk.catalog.datasource_resource.DatasourceResource` for catalog calls."""
|
|
258
|
+
if isinstance(assembly, DatasourceResource):
|
|
259
|
+
if assembly.datasource_service is self.datasource_service:
|
|
260
|
+
return assembly
|
|
261
|
+
return DatasourceResource(
|
|
262
|
+
self.datasource_service, Assembly.model_validate(assembly.to_dict())
|
|
263
|
+
)
|
|
264
|
+
return DatasourceResource(self.datasource_service, assembly)
|
|
265
|
+
|
|
266
|
+
def get_datasource_resource(
|
|
267
|
+
self,
|
|
268
|
+
assembly_identifier: Any,
|
|
269
|
+
*,
|
|
270
|
+
properties: bool = False,
|
|
271
|
+
) -> DatasourceResource:
|
|
272
|
+
"""Alias for :meth:`get_datasource` (same return type)."""
|
|
273
|
+
return self.get_datasource(assembly_identifier, properties=properties)
|
|
274
|
+
|
|
275
|
+
def start_crawler(
|
|
276
|
+
self,
|
|
277
|
+
datasource_name: str,
|
|
278
|
+
*,
|
|
279
|
+
transient_retry: RetryConfig | None = None,
|
|
280
|
+
) -> CrawlerActionResponse:
|
|
281
|
+
"""POST to start a crawler.
|
|
282
|
+
|
|
283
|
+
Prefer :meth:`get_datasource` (or :meth:`datasource_resource`) and
|
|
284
|
+
:meth:`~acceldata.models.sdk.catalog.datasource_resource.DatasourceResource.start_crawler`
|
|
285
|
+
so the call goes through a datasource handle instead of passing a bare name string.
|
|
286
|
+
"""
|
|
287
|
+
return self.datasource_service.start_crawler(datasource_name, transient_retry=transient_retry)
|
|
288
|
+
|
|
289
|
+
def get_asset(self, identifier: str | int) -> AssetResource:
|
|
290
|
+
"""Resolve a catalog asset by numeric id or uid string."""
|
|
291
|
+
return self.asset_service.get_asset(identifier)
|
|
292
|
+
|
|
293
|
+
def get_asset_types(self) -> list[AssetType]:
|
|
294
|
+
"""Return all asset types defined in the catalog."""
|
|
295
|
+
return self.generic_service.get_asset_types()
|
|
296
|
+
|
|
297
|
+
def get_all_asset_types(self) -> list[AssetType]:
|
|
298
|
+
"""Alias for :meth:`get_asset_types`."""
|
|
299
|
+
return self.get_asset_types()
|
|
300
|
+
|
|
301
|
+
def get_asset_tags(self, asset_id: int) -> list[AssetTagInfo]:
|
|
302
|
+
"""GET tags for one catalog asset."""
|
|
303
|
+
return self.asset_service.get_asset_tags(asset_id)
|
|
304
|
+
|
|
305
|
+
def add_asset_tag(self, asset_id: int, payload: AssetTagRequest) -> AssetTagInfo:
|
|
306
|
+
"""POST a tag on a catalog asset."""
|
|
307
|
+
return self.asset_service.add_asset_tag(asset_id, payload)
|
|
308
|
+
|
|
309
|
+
def add_asset_labels(self, asset_id: int, payload: AssetLabelRequest) -> list[Label]:
|
|
310
|
+
"""PUT labels on a catalog asset."""
|
|
311
|
+
return self.asset_service.add_asset_labels(asset_id, payload)
|
|
312
|
+
|
|
313
|
+
def get_asset_labels(self, asset_id: int) -> list[Label]:
|
|
314
|
+
"""GET labels for one catalog asset."""
|
|
315
|
+
return self.asset_service.get_asset_labels(asset_id)
|
|
316
|
+
|
|
317
|
+
def get_asset_metadata(self, asset_id: int) -> CatalogAssetMetaData:
|
|
318
|
+
return self.asset_service.get_asset_metadata(asset_id)
|
|
319
|
+
|
|
320
|
+
def add_custom_metadata(
|
|
321
|
+
self, asset_id: int, custom_metadata: Mapping[str, str]
|
|
322
|
+
) -> CatalogAssetMetaData:
|
|
323
|
+
return self.asset_service.add_custom_metadata(asset_id, custom_metadata)
|
|
324
|
+
|
|
325
|
+
def asset_resource(self, asset: Asset | AssetResource) -> AssetResource:
|
|
326
|
+
"""Return an :class:`~acceldata.models.sdk.catalog.asset_resource.AssetResource` for catalog calls scoped to ``asset``."""
|
|
327
|
+
if isinstance(asset, AssetResource):
|
|
328
|
+
if asset.asset_service is self.asset_service:
|
|
329
|
+
return asset
|
|
330
|
+
return AssetResource(
|
|
331
|
+
self.asset_service, Asset.model_validate(asset.to_dict())
|
|
332
|
+
)
|
|
333
|
+
return AssetResource(self.asset_service, asset)
|
|
334
|
+
|
|
335
|
+
def profile_request_resource(
|
|
336
|
+
self, profile_request: ProfileRequest | ProfileRequestResource
|
|
337
|
+
) -> ProfileRequestResource:
|
|
338
|
+
"""Wrap a profile request (or an existing :class:`ProfileRequestResource`) for this client."""
|
|
339
|
+
if isinstance(profile_request, ProfileRequestResource):
|
|
340
|
+
if profile_request.asset_service is self.asset_service:
|
|
341
|
+
return profile_request
|
|
342
|
+
return ProfileRequestResource(
|
|
343
|
+
self.asset_service, ProfileRequest.model_validate(profile_request.to_dict())
|
|
344
|
+
)
|
|
345
|
+
return ProfileRequestResource(self.asset_service, profile_request)
|
|
346
|
+
|
|
347
|
+
def profile_resource(self, profile_request: ProfileRequest) -> ProfileResource:
|
|
348
|
+
"""Alias of :meth:`profile_request_resource`; returns :class:`~acceldata.models.sdk.catalog.profile_request_resource.ProfileResource`."""
|
|
349
|
+
return self.profile_request_resource(profile_request)
|
|
350
|
+
|
|
351
|
+
def cancel_profile(self, profile_req_id: int):
|
|
352
|
+
return self.asset_service.cancel_profile(profile_req_id)
|
|
353
|
+
|
|
354
|
+
def get_profile_request_details(
|
|
355
|
+
self, asset_id: int, req_id: int
|
|
356
|
+
) -> ProfileRequestResource:
|
|
357
|
+
pr = self.asset_service.get_profile_request_details(asset_id, req_id)
|
|
358
|
+
return ProfileRequestResource(self.asset_service, pr)
|
|
359
|
+
|
|
360
|
+
def get_profile_status(self, asset_id: int, req_id: int) -> ProfileRequestResource:
|
|
361
|
+
"""Same as :meth:`get_profile_request_details`."""
|
|
362
|
+
return self.get_profile_request_details(asset_id, req_id)
|
|
363
|
+
|
|
364
|
+
def profile_asset(
|
|
365
|
+
self,
|
|
366
|
+
asset_id: int,
|
|
367
|
+
profiling_params: Optional[AssetProfilingParams] = None,
|
|
368
|
+
*,
|
|
369
|
+
sync: bool = False,
|
|
370
|
+
transient_retry: RetryConfig | None = None,
|
|
371
|
+
) -> ProfileRequestResource:
|
|
372
|
+
"""Start profiling for an asset.
|
|
373
|
+
|
|
374
|
+
``sync=False`` (default) is fire-and-forget and returns the initial
|
|
375
|
+
request details. ``sync=True`` blocks and polls by request id until the
|
|
376
|
+
profiling request reaches a non-running status.
|
|
377
|
+
"""
|
|
378
|
+
return self.asset_service.profile_asset(
|
|
379
|
+
asset_id,
|
|
380
|
+
profiling_params,
|
|
381
|
+
sync=sync,
|
|
382
|
+
transient_retry=transient_retry,
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
def get_latest_profile_status(self, asset_id: int):
|
|
386
|
+
return self.asset_service.get_latest_profile_status(asset_id)
|
|
387
|
+
|
|
388
|
+
def get_sample_data_result(self, request_id: str | SampleDataApiResponse | None) -> SampleDataApiResponse | None:
|
|
389
|
+
return self.asset_service.get_sample_data_result(request_id)
|
|
390
|
+
|
|
391
|
+
def sample_data(
|
|
392
|
+
self,
|
|
393
|
+
asset_id: int,
|
|
394
|
+
*,
|
|
395
|
+
sync: bool = True,
|
|
396
|
+
) -> SampleDataApiResponse | None:
|
|
397
|
+
return self.asset_service.sample_data(asset_id, sync=sync)
|
|
398
|
+
|
|
399
|
+
def list_all_policies(
|
|
400
|
+
self,
|
|
401
|
+
policy_filter: PolicyFilter,
|
|
402
|
+
page: int = 0,
|
|
403
|
+
size: int = 25,
|
|
404
|
+
with_latest_execution: bool = True,
|
|
405
|
+
sort_by: str = "updatedAt:DESC",
|
|
406
|
+
) -> RulesWithLatestExecutionResponse | None:
|
|
407
|
+
"""List catalog rules (GET ``/rules``) with optional paging and latest execution payload."""
|
|
408
|
+
return self.rule_service.get_all_rules(
|
|
409
|
+
policy_filter,
|
|
410
|
+
page=page,
|
|
411
|
+
size=size,
|
|
412
|
+
with_latest_execution=with_latest_execution,
|
|
413
|
+
sort_by=sort_by,
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
def get_policy(
|
|
417
|
+
self,
|
|
418
|
+
type: PolicyType | None = None,
|
|
419
|
+
identifier: str | int | None = None,
|
|
420
|
+
) -> (
|
|
421
|
+
QualityRule
|
|
422
|
+
| DataQualityRuleResponse
|
|
423
|
+
| ReconciliationRuleResponse
|
|
424
|
+
| DataCadenceRuleResponse
|
|
425
|
+
):
|
|
426
|
+
"""Fetch one catalog rule by id or name.
|
|
427
|
+
|
|
428
|
+
Without ``type``, calls GET ``/rules/{identifier}`` and returns a
|
|
429
|
+
:class:`~acceldata.models.api.catalog.quality_rule.QualityRule`.
|
|
430
|
+
|
|
431
|
+
With ``type``, calls the typed rule endpoint (data-quality, reconciliation, or data-cadence)
|
|
432
|
+
and returns :class:`~acceldata.models.api.catalog.data_quality_rule_response.DataQualityRuleResponse`,
|
|
433
|
+
:class:`~acceldata.models.api.catalog.reconciliation_rule_response.ReconciliationRuleResponse`
|
|
434
|
+
(catalog ``Reconciliation.RuleResponse``), or
|
|
435
|
+
:class:`~acceldata.models.api.catalog.data_cadence_rule_response.DataCadenceRuleResponse`
|
|
436
|
+
(catalog ``DataCadenceRule.RuleResponse``).
|
|
437
|
+
|
|
438
|
+
:param identifier: Rule id or name (required).
|
|
439
|
+
:param type: Optional policy kind; when set, selects the typed GET path.
|
|
440
|
+
"""
|
|
441
|
+
if identifier is None:
|
|
442
|
+
raise ValueError("Parameter 'identifier' is mandatory.")
|
|
443
|
+
|
|
444
|
+
if type is None:
|
|
445
|
+
return self.rule_service.get_policy(identifier)
|
|
446
|
+
|
|
447
|
+
if type == PolicyType.DATA_QUALITY:
|
|
448
|
+
return self.rule_service.get_dq_rule(identifier)
|
|
449
|
+
if type == PolicyType.RECONCILIATION:
|
|
450
|
+
return self.rule_service.get_reconciliation_rule(identifier)
|
|
451
|
+
if type == PolicyType.DATA_CADENCE:
|
|
452
|
+
return self.rule_service.get_freshness_rule(identifier)
|
|
453
|
+
allowed = (PolicyType.DATA_QUALITY, PolicyType.RECONCILIATION, PolicyType.DATA_CADENCE)
|
|
454
|
+
names = ", ".join(p.name for p in allowed)
|
|
455
|
+
raise InvalidPolicyTypeError(
|
|
456
|
+
f"Invalid policy type {type!r}. Use one of: {names}, or omit ``type`` to call GET /rules/{{identifier}}.",
|
|
457
|
+
allowed_policy_types=tuple(p.name for p in allowed),
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
def get_data_quality_rule_resource(self, identifier: str | int) -> DataQualityRuleResource:
|
|
461
|
+
"""Typed rule as :class:`~acceldata.models.sdk.catalog.policy_rule_resources.DataQualityRuleResource` (execute, status, executions)."""
|
|
462
|
+
m = self.rule_service.get_dq_rule(identifier)
|
|
463
|
+
return DataQualityRuleResource(self, m, identifier)
|
|
464
|
+
|
|
465
|
+
def get_reconciliation_rule_resource(self, identifier: str | int) -> ReconciliationRuleResource:
|
|
466
|
+
"""Reconciliation rule resource (typed GET, executions, and helpers)."""
|
|
467
|
+
m = self.rule_service.get_reconciliation_rule(identifier)
|
|
468
|
+
return ReconciliationRuleResource(self, m, identifier)
|
|
469
|
+
|
|
470
|
+
def get_data_cadence_rule_resource(self, identifier: str | int) -> DataCadenceRuleResource:
|
|
471
|
+
"""Data-cadence (freshness) rule resource."""
|
|
472
|
+
m = self.rule_service.get_freshness_rule(identifier)
|
|
473
|
+
return DataCadenceRuleResource(self, m, identifier)
|
|
474
|
+
|
|
475
|
+
def get_dq_policy_resource(self, identifier: str | int) -> DataQualityRuleResource:
|
|
476
|
+
"""Alias for :meth:`get_data_quality_rule_resource` — typed DQ (data-quality) policy handle."""
|
|
477
|
+
return self.get_data_quality_rule_resource(identifier)
|
|
478
|
+
|
|
479
|
+
def get_recon_policy_resource(self, identifier: str | int) -> ReconciliationRuleResource:
|
|
480
|
+
"""Alias for :meth:`get_reconciliation_rule_resource` — typed reconciliation policy handle."""
|
|
481
|
+
return self.get_reconciliation_rule_resource(identifier)
|
|
482
|
+
|
|
483
|
+
def get_cadence_policy_resource(self, identifier: str | int) -> DataCadenceRuleResource:
|
|
484
|
+
"""Alias for :meth:`get_data_cadence_rule_resource` — typed data-cadence (freshness) policy handle."""
|
|
485
|
+
return self.get_data_cadence_rule_resource(identifier)
|
|
486
|
+
|
|
487
|
+
def policy_executions(
|
|
488
|
+
self,
|
|
489
|
+
identifier: str | int,
|
|
490
|
+
rule_type: RuleType,
|
|
491
|
+
page: int = 0,
|
|
492
|
+
size: int = 25,
|
|
493
|
+
sort_by: str = "finishedAt:DESC",
|
|
494
|
+
) -> list[GenericExecution]:
|
|
495
|
+
"""List past runs for a catalog rule.
|
|
496
|
+
|
|
497
|
+
Data-quality and reconciliation rules use ``GET /rules/{{kind}}/{{id}}/executions``.
|
|
498
|
+
All other kinds use ``GET /rules/executions`` with ``ruleId`` (and paging) as in the catalog API.
|
|
499
|
+
|
|
500
|
+
The API may return a flat ``executions`` list or a wrapped body (e.g.
|
|
501
|
+
``DataQuality.ExecutionsResponse`` / ``Reconciliation.ExecutionsResponse``); both are handled.
|
|
502
|
+
|
|
503
|
+
Each list row is deserialized to the concrete execution wrapper for that ``rule_type``
|
|
504
|
+
(e.g. :class:`~acceldata.models.api.catalog.data_quality_execution.DataQualityExecution` for
|
|
505
|
+
data-quality), then wrapped in :class:`~acceldata.models.api.catalog.generic_execution.GenericExecution`.
|
|
506
|
+
Pass a numeric rule id, or a rule name (resolved via the typed rule GET, or ``GET /rules/{{name}}``
|
|
507
|
+
where applicable).
|
|
508
|
+
"""
|
|
509
|
+
return self.rule_service.policy_executions(
|
|
510
|
+
identifier, rule_type, page=page, size=size, sort_by=sort_by
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
def get_reconciliation_rule_execution_details(
|
|
514
|
+
self, execution_id: str | int
|
|
515
|
+
) -> ReconciliationRuleExecution:
|
|
516
|
+
"""GET ``/rules/reconciliation/executions/{execution_id}`` (Reconciliation.Execution)."""
|
|
517
|
+
return self.rule_service.get_reconciliation_rule_execution_details(execution_id)
|
|
518
|
+
|
|
519
|
+
def get_dq_rule_execution_details(self, execution_id: str | int) -> DataQualityExecution:
|
|
520
|
+
"""GET ``/rules/data-quality/executions/{execution_id}`` (DataQualityExecution)."""
|
|
521
|
+
return self.rule_service.get_dq_rule_execution_details(execution_id)
|
|
522
|
+
|
|
523
|
+
def get_reconciliation_rule_result(self, execution_id: str | int) -> ExecutionResult:
|
|
524
|
+
"""GET ``/rules/reconciliation/executions/{execution_id}/result`` — :class:`~acceldata.models.api.catalog.execution_result.ExecutionResult`."""
|
|
525
|
+
return self.rule_service.get_reconciliation_rule_result(execution_id)
|
|
526
|
+
|
|
527
|
+
def execute_dq_rule(
|
|
528
|
+
self,
|
|
529
|
+
rule_id: str | int,
|
|
530
|
+
policy_execution_request: PolicyExecutionRequestInput,
|
|
531
|
+
) -> GenericExecution:
|
|
532
|
+
"""POST ``/rules/data-quality/{rule_id}/executions`` — start a DQ run; response is :class:`GenericExecution`."""
|
|
533
|
+
return self.rule_service.execute_dq_rule(
|
|
534
|
+
rule_id,
|
|
535
|
+
policy_execution_request,
|
|
536
|
+
)
|
|
537
|
+
|
|
538
|
+
def execute_reconciliation_rule(
|
|
539
|
+
self,
|
|
540
|
+
rule_id: str | int,
|
|
541
|
+
policy_execution_request: PolicyExecutionRequestInput,
|
|
542
|
+
) -> GenericExecution:
|
|
543
|
+
"""POST ``/rules/reconciliation/{rule_id}/executions`` — start a reconciliation run; :class:`GenericExecution`."""
|
|
544
|
+
return self.rule_service.execute_reconciliation_rule(
|
|
545
|
+
rule_id,
|
|
546
|
+
policy_execution_request,
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
def execute_freshness_rule(
|
|
550
|
+
self,
|
|
551
|
+
rule_id: str | int,
|
|
552
|
+
policy_execution_request: PolicyExecutionRequestInput,
|
|
553
|
+
) -> GenericExecution:
|
|
554
|
+
"""POST ``/rules/data-cadence/{rule_id}/executions`` — start a cadence/freshness run; :class:`GenericExecution`."""
|
|
555
|
+
return self.rule_service.execute_freshness_rule(
|
|
556
|
+
rule_id,
|
|
557
|
+
policy_execution_request,
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
def get_dq_rule_result(self, execution_id: str | int) -> ExecutionResult:
|
|
561
|
+
"""GET ``/rules/data-quality/executions/{execution_id}/result`` — result for :meth:`execute_dq_rule`."""
|
|
562
|
+
return self.rule_service.get_dq_rule_result(execution_id)
|
|
563
|
+
|
|
564
|
+
def get_freshness_rule_result(self, execution_id: str | int) -> ExecutionResult:
|
|
565
|
+
"""GET ``/rules/data-cadence/executions/{execution_id}/result`` — result for :meth:`execute_freshness_rule`."""
|
|
566
|
+
return self.rule_service.get_freshness_rule_result(execution_id)
|
|
567
|
+
|
|
568
|
+
def get_data_cadence_rule_execution_details(
|
|
569
|
+
self, execution_id: str | int
|
|
570
|
+
) -> DataCadenceRuleExecution:
|
|
571
|
+
"""GET ``/rules/data-cadence/executions/{execution_id}`` — :class:`DataCadenceRuleExecution` (parity with DQ/recon execution GET)."""
|
|
572
|
+
return self.rule_service.get_data_cadence_rule_execution_details(execution_id)
|
|
573
|
+
|
|
574
|
+
def get_policy_execution_status(
|
|
575
|
+
self,
|
|
576
|
+
rule_type: RuleType,
|
|
577
|
+
execution_id: str | int,
|
|
578
|
+
*,
|
|
579
|
+
transient_retry: RetryConfig | None = None,
|
|
580
|
+
) -> RuleExecutionStatus:
|
|
581
|
+
"""Return the current execution result status for ``execution_id``.
|
|
582
|
+
|
|
583
|
+
Uses the catalog ``GET .../executions/{{id}}/result`` contract, wired only for
|
|
584
|
+
data-quality, reconciliation (including equality), and data-cadence. Other rule
|
|
585
|
+
kinds should use :meth:`policy_executions`. Starting runs remains limited to
|
|
586
|
+
:meth:`execute_policy` / :class:`~acceldata.models.sdk.catalog.executor.Executor`.
|
|
587
|
+
"""
|
|
588
|
+
result_call = get_result_callable_for_policy_polling(rule_type, self)
|
|
589
|
+
cfg = effective_transient_retry(None, transient_retry)
|
|
590
|
+
return policy_execution_status_via_result(result_call, execution_id, cfg)
|
|
591
|
+
|
|
592
|
+
def get_policy_execution_result(
|
|
593
|
+
self,
|
|
594
|
+
rule_type: RuleType,
|
|
595
|
+
execution_id: str | int,
|
|
596
|
+
*,
|
|
597
|
+
failure_strategy: FailureStrategy = FailureStrategy.DoNotFail,
|
|
598
|
+
transient_retry: RetryConfig | None = None,
|
|
599
|
+
) -> ExecutionResult:
|
|
600
|
+
"""Block until a terminal result for ``execution_id``; returns :class:`~acceldata.models.api.catalog.execution_result.ExecutionResult`.
|
|
601
|
+
|
|
602
|
+
Same rule-kind limits as :meth:`get_policy_execution_status`.
|
|
603
|
+
"""
|
|
604
|
+
result_call = get_result_callable_for_policy_polling(rule_type, self)
|
|
605
|
+
cfg = effective_transient_retry(None, transient_retry)
|
|
606
|
+
return policy_execution_result_via_poll(
|
|
607
|
+
result_call,
|
|
608
|
+
execution_id,
|
|
609
|
+
sleep_interval=5.0,
|
|
610
|
+
failure_strategy=failure_strategy,
|
|
611
|
+
retry_cfg=cfg,
|
|
612
|
+
total_retries=POLICY_POLL_UNLIMITED_RETRIES,
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
def cancel_rule_execution(self, execution_id: str | int) -> ExecutionCancellationResponse:
|
|
616
|
+
"""PUT ``/rules/execution/{execution_id}/cancel`` — cancel a running execution."""
|
|
617
|
+
return self.rule_service.cancel_rule_execution(execution_id)
|
|
618
|
+
|
|
619
|
+
def enable_rule(self, rule_id: str | int) -> QualityRule:
|
|
620
|
+
"""PUT ``/rules/{rule_id}/enable`` with :class:`~acceldata.models.api.catalog.enable_rule_request.EnableRuleRequest` (``enable: true``); returns :class:`QualityRule`."""
|
|
621
|
+
return self.rule_service.enable_rule(rule_id)
|
|
622
|
+
|
|
623
|
+
def disable_rule(self, rule_id: str | int) -> QualityRule:
|
|
624
|
+
"""PUT ``/rules/{rule_id}/enable`` with ``EnableRuleRequest`` (``enable: false``); returns :class:`QualityRule`."""
|
|
625
|
+
return self.rule_service.disable_rule(rule_id)
|
|
626
|
+
|
|
627
|
+
def execute_policy(
|
|
628
|
+
self,
|
|
629
|
+
rule_type: RuleType,
|
|
630
|
+
rule_id: str | int,
|
|
631
|
+
policy_execution_request: PolicyExecutionRequestInput,
|
|
632
|
+
*,
|
|
633
|
+
sync: bool = True,
|
|
634
|
+
failure_strategy: FailureStrategy = FailureStrategy.DoNotFail,
|
|
635
|
+
sleep_interval: float = 5.0,
|
|
636
|
+
total_retries: int = POLICY_POLL_UNLIMITED_RETRIES,
|
|
637
|
+
transient_retry: RetryConfig | None = None,
|
|
638
|
+
pipeline_run_id: int | None = None,
|
|
639
|
+
) -> Executor:
|
|
640
|
+
"""Run a catalog rule via :class:`~acceldata.models.sdk.catalog.executor.Executor`.
|
|
641
|
+
|
|
642
|
+
Returns the same ``Executor`` instance used to start (and optionally block on) the run;
|
|
643
|
+
call :meth:`~acceldata.models.sdk.catalog.executor.Executor.get_result` or ``get_status`` on it.
|
|
644
|
+
|
|
645
|
+
``pipeline_run_id`` — optional catalog pipeline run id; when set, it is sent on the execution
|
|
646
|
+
request (overriding ``pipelineRunId`` on ``policy_execution_request`` when both are present).
|
|
647
|
+
|
|
648
|
+
Default ``sync=True`` blocks until a terminal result (legacy ``TorchClient`` parity). Pass
|
|
649
|
+
``sync=False`` to return after the run is accepted and poll later via the ``Executor``.
|
|
650
|
+
|
|
651
|
+
When ``sync=True``, ``sleep_interval`` and ``total_retries`` are passed to
|
|
652
|
+
:meth:`~acceldata.models.sdk.catalog.executor.Executor.get_execution_result` (``total_retries`` defaults to
|
|
653
|
+
``POLICY_POLL_UNLIMITED_RETRIES`` / ``-1`` for no cap on RUNNING/WAITING poll rounds).
|
|
654
|
+
"""
|
|
655
|
+
executor = Executor(rule_type, self, sync=sync, transient_retry=transient_retry)
|
|
656
|
+
effective_request = policy_request_with_pipeline_run_id(
|
|
657
|
+
policy_execution_request, pipeline_run_id
|
|
658
|
+
)
|
|
659
|
+
return executor.execute(
|
|
660
|
+
rule_id,
|
|
661
|
+
effective_request,
|
|
662
|
+
sleep_interval=sleep_interval,
|
|
663
|
+
total_retries=total_retries,
|
|
664
|
+
failure_strategy=failure_strategy,
|
|
665
|
+
transient_retry=transient_retry,
|
|
666
|
+
)
|