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
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
class CatalogUrls:
|
|
2
|
+
def __init__(self, base_url: str) -> None:
|
|
3
|
+
if not base_url.startswith("http"):
|
|
4
|
+
raise ValueError(f"Invalid base_url: {base_url}")
|
|
5
|
+
self._base = base_url.rstrip("/")
|
|
6
|
+
|
|
7
|
+
def assets_by_ids(self, asset_ids: int | list[int] | tuple[int, ...]) -> str:
|
|
8
|
+
if isinstance(asset_ids, (list, tuple)):
|
|
9
|
+
ids = ",".join(str(asset_id) for asset_id in asset_ids)
|
|
10
|
+
else:
|
|
11
|
+
ids = str(asset_ids)
|
|
12
|
+
return f"{self._base}/assets?ids={ids}"
|
|
13
|
+
|
|
14
|
+
def assets_by_uid(self, uid: str) -> str:
|
|
15
|
+
return f"{self._base}/assets?uid={uid}"
|
|
16
|
+
|
|
17
|
+
def asset_metadata(self, asset_id: int) -> str:
|
|
18
|
+
return f"{self._base}/assets/{asset_id}/metadata"
|
|
19
|
+
|
|
20
|
+
def asset_custom_metadata(self, asset_id: int) -> str:
|
|
21
|
+
return f"{self._base}/assets/{asset_id}/metadata/custom"
|
|
22
|
+
|
|
23
|
+
def asset_profile(self, asset_id: int) -> str:
|
|
24
|
+
return f"{self._base}/assets/{asset_id}/profile"
|
|
25
|
+
|
|
26
|
+
def profile_request_details(self, asset_id: int, req_id: int) -> str:
|
|
27
|
+
return f"{self._base}/assets/{asset_id}/profile/{req_id}"
|
|
28
|
+
|
|
29
|
+
def profile_cancel(self, profile_req_id: int) -> str:
|
|
30
|
+
return f"{self._base}/assets/profile/{profile_req_id}/cancel"
|
|
31
|
+
|
|
32
|
+
def asset_tags(self, asset_id: int) -> str:
|
|
33
|
+
return f"{self._base}/assets/{asset_id}/tags"
|
|
34
|
+
|
|
35
|
+
def assets_tags(self) -> str:
|
|
36
|
+
return f"{self._base}/assets/tags"
|
|
37
|
+
|
|
38
|
+
def asset_tag(self, asset_id: int) -> str:
|
|
39
|
+
return f"{self._base}/assets/{asset_id}/tag"
|
|
40
|
+
|
|
41
|
+
def asset_labels(self, asset_id: int) -> str:
|
|
42
|
+
return f"{self._base}/assets/{asset_id}/labels"
|
|
43
|
+
|
|
44
|
+
def asset_sample_async(self, asset_id: int) -> str:
|
|
45
|
+
return f"{self._base}/assets/{asset_id}/sample/async"
|
|
46
|
+
|
|
47
|
+
def asset_sample_result(self, request_id: str) -> str:
|
|
48
|
+
return f"{self._base}/assets/sample/result/{request_id}"
|
|
49
|
+
|
|
50
|
+
def asset_types(self) -> str:
|
|
51
|
+
return f"{self._base}/asset-types"
|
|
52
|
+
|
|
53
|
+
def source_types(self) -> str:
|
|
54
|
+
return f"{self._base}/source-types"
|
|
55
|
+
|
|
56
|
+
def connection_types(self) -> str:
|
|
57
|
+
return f"{self._base}/connection-types"
|
|
58
|
+
|
|
59
|
+
def crawl_datasource(self,datasource_name: str) -> str:
|
|
60
|
+
return f"{self._base}/crawler/{datasource_name}"
|
|
61
|
+
|
|
62
|
+
def datasources(self) -> str:
|
|
63
|
+
return f"{self._base}/assemblies"
|
|
64
|
+
|
|
65
|
+
def assembly_resource(self, assembly_identifier: str | int) -> str:
|
|
66
|
+
"""Path to one assembly (datasource) without query string (e.g. DELETE)."""
|
|
67
|
+
return f"{self._base}/assemblies/{assembly_identifier}"
|
|
68
|
+
|
|
69
|
+
def assembly(self, assembly_identifier: str | int, *, properties: bool = False) -> str:
|
|
70
|
+
"""GET single assembly (datasource) by numeric id or name."""
|
|
71
|
+
base = self.assembly_resource(assembly_identifier)
|
|
72
|
+
return f"{base}?properties={'true' if properties else 'false'}"
|
|
73
|
+
|
|
74
|
+
def analytics_pipeline(self, pipeline_identifier: str | int) -> str:
|
|
75
|
+
"""GET one analytics pipeline by numeric id or name (path segment)."""
|
|
76
|
+
return f"{self._base}/analytics-pipelines/{pipeline_identifier}"
|
|
77
|
+
|
|
78
|
+
def rules(self)->str:
|
|
79
|
+
return f"{self._base}/rules"
|
|
80
|
+
|
|
81
|
+
def rules_executions(self) -> str:
|
|
82
|
+
"""GET ``/rules/executions`` — list executions (use query params ``ruleId``, ``page``, ``size``, ``sortBy``)."""
|
|
83
|
+
return f"{self.rules()}/executions"
|
|
84
|
+
|
|
85
|
+
def rule_by_identifier(self, identifier: str | int) -> str:
|
|
86
|
+
"""GET ``/rules/{identifier}`` — generic rule (``QualityRule``)."""
|
|
87
|
+
return f"{self.rules()}/{identifier}"
|
|
88
|
+
|
|
89
|
+
def data_quality_rule(self, identifier: str | int) -> str:
|
|
90
|
+
"""GET ``/rules/data-quality/{identifier}`` — DQ rule payload (``RuleResponse``)."""
|
|
91
|
+
return f"{self.rules()}/data-quality/{identifier}"
|
|
92
|
+
|
|
93
|
+
def reconciliation_rule(self, identifier: str | int) -> str:
|
|
94
|
+
"""GET ``/rules/reconciliation/{identifier}``."""
|
|
95
|
+
return f"{self.rules()}/reconciliation/{identifier}"
|
|
96
|
+
|
|
97
|
+
def data_cadence_rule(self, identifier: str | int) -> str:
|
|
98
|
+
"""GET ``/rules/data-cadence/{identifier}``."""
|
|
99
|
+
return f"{self.rules()}/data-cadence/{identifier}"
|
|
100
|
+
|
|
101
|
+
def data_quality_rule_executions(self, rule_id: str | int) -> str:
|
|
102
|
+
return f"{self.rules()}/data-quality/{rule_id}/executions"
|
|
103
|
+
|
|
104
|
+
def reconciliation_rule_executions(self, rule_id: str | int) -> str:
|
|
105
|
+
return f"{self.rules()}/reconciliation/{rule_id}/executions"
|
|
106
|
+
|
|
107
|
+
def data_cadence_rule_executions(self, rule_id: str | int) -> str:
|
|
108
|
+
return f"{self.rules()}/data-cadence/{rule_id}/executions"
|
|
109
|
+
|
|
110
|
+
def data_quality_rule_execution(self, execution_id: str | int) -> str:
|
|
111
|
+
"""GET ``/rules/data-quality/executions/{execution_id}`` — DQ execution details."""
|
|
112
|
+
return f"{self.rules()}/data-quality/executions/{execution_id}"
|
|
113
|
+
|
|
114
|
+
def data_quality_rule_execution_result(self, execution_id: str | int) -> str:
|
|
115
|
+
return f"{self.rules()}/data-quality/executions/{execution_id}/result"
|
|
116
|
+
|
|
117
|
+
def reconciliation_rule_execution(self, execution_id: str | int) -> str:
|
|
118
|
+
"""GET ``/rules/reconciliation/executions/{execution_id}`` — execution details (Reconciliation.Execution)."""
|
|
119
|
+
return f"{self.rules()}/reconciliation/executions/{execution_id}"
|
|
120
|
+
|
|
121
|
+
def reconciliation_rule_execution_result(self, execution_id: str | int) -> str:
|
|
122
|
+
return f"{self.rules()}/reconciliation/executions/{execution_id}/result"
|
|
123
|
+
|
|
124
|
+
def data_cadence_rule_execution_result(self, execution_id: str | int) -> str:
|
|
125
|
+
return f"{self.rules()}/data-cadence/executions/{execution_id}/result"
|
|
126
|
+
|
|
127
|
+
def data_cadence_rule_execution(self, execution_id: str | int) -> str:
|
|
128
|
+
"""GET ``/rules/data-cadence/executions/{execution_id}`` — cadence execution details."""
|
|
129
|
+
return f"{self.rules()}/data-cadence/executions/{execution_id}"
|
|
130
|
+
|
|
131
|
+
def cancel_rule_execution(self, execution_id: str | int) -> str:
|
|
132
|
+
return f"{self.rules()}/execution/{execution_id}/cancel"
|
|
133
|
+
|
|
134
|
+
def rule_enable(self, rule_id: str | int) -> str:
|
|
135
|
+
"""PUT ``/rules/{rule_id}/enable`` — body ``EnableRuleRequest`` (``enable`` true/false)."""
|
|
136
|
+
return f"{self.rules()}/{rule_id}/enable"
|
|
137
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
class PipelineUrls:
|
|
2
|
+
"""Build pipeline control-plane REST paths (see :data:`~acceldata.constants.PIPELINE_API_PATH`)."""
|
|
3
|
+
|
|
4
|
+
def __init__(self, base_url: str) -> None:
|
|
5
|
+
if not base_url.startswith("http"):
|
|
6
|
+
raise ValueError(f"Invalid base_url: {base_url}")
|
|
7
|
+
self._base = base_url.rstrip("/")
|
|
8
|
+
|
|
9
|
+
def pipelines_root(self) -> str:
|
|
10
|
+
return f"{self._base}/pipelines"
|
|
11
|
+
|
|
12
|
+
def pipeline_by_identity(self, identity: str | int) -> str:
|
|
13
|
+
return f"{self._base}/pipelines/{identity}"
|
|
14
|
+
|
|
15
|
+
def pipelines_summary(self) -> str:
|
|
16
|
+
return f"{self._base}/pipelines/summary"
|
|
17
|
+
|
|
18
|
+
def pipeline_jobs(self, pipeline_id: int) -> str:
|
|
19
|
+
return f"{self._base}/pipelines/{pipeline_id}/jobs"
|
|
20
|
+
|
|
21
|
+
def pipeline_runs(self, pipeline_id: int) -> str:
|
|
22
|
+
return f"{self._base}/pipelines/{pipeline_id}/runs"
|
|
23
|
+
|
|
24
|
+
def pipeline_latest_run(self, pipeline_id: int) -> str:
|
|
25
|
+
return f"{self._base}/pipelines/{pipeline_id}/latestRun"
|
|
26
|
+
|
|
27
|
+
def pipeline_run_by_id(self, pipeline_run_id: int) -> str:
|
|
28
|
+
return f"{self._base}/pipelines/runs/{pipeline_run_id}"
|
|
29
|
+
|
|
30
|
+
def pipeline_run_spans(self, pipeline_run_id: int) -> str:
|
|
31
|
+
return f"{self._base}/pipelines/runs/{pipeline_run_id}/spans"
|
|
32
|
+
|
|
33
|
+
def pipeline_run_span_by_uid(self, pipeline_run_id: int, span_identity: str) -> str:
|
|
34
|
+
return f"{self._base}/pipelines/runs/{pipeline_run_id}/spans/{span_identity}"
|
|
35
|
+
|
|
36
|
+
def span_child_spans(self, span_id: int) -> str:
|
|
37
|
+
return f"{self._base}/pipelines/spans/{span_id}/childSpans"
|
|
38
|
+
|
|
39
|
+
def span_events(self, span_id: int) -> str:
|
|
40
|
+
return f"{self._base}/pipelines/spans/{span_id}/events"
|
|
41
|
+
|
|
42
|
+
def pipeline_graph(self, pipeline_id: int) -> str:
|
|
43
|
+
return f"{self._base}/pipelines/{pipeline_id}/graph"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def pipeline_graph_by_version_id(self, pipeline_id: int,version_id: int) -> str:
|
|
47
|
+
return f"{self._base}/pipelines/{pipeline_id}/graph?versionId={version_id}"
|
|
48
|
+
|
|
49
|
+
def pipeline_summary(self) -> str:
|
|
50
|
+
"""Deprecated alias for :meth:`pipelines_summary`."""
|
|
51
|
+
return self.pipelines_summary()
|
|
52
|
+
|
|
53
|
+
def pipeline_identity(self, identity: str | int) -> str:
|
|
54
|
+
"""Deprecated alias for :meth:`pipeline_by_id`."""
|
|
55
|
+
return self.pipeline_by_identity(identity)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Datetime helpers aligned with prior SDK behavior for pipeline span events."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DateTimeFormatter:
|
|
10
|
+
@staticmethod
|
|
11
|
+
def format_datetime(date_time: Optional[datetime]) -> Optional[str]:
|
|
12
|
+
if date_time is None:
|
|
13
|
+
return None
|
|
14
|
+
if isinstance(date_time, datetime):
|
|
15
|
+
return date_time.isoformat()
|
|
16
|
+
raise ValueError("Input is not a valid datetime object")
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Debug-level operation outcome markers for integration and support logs."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def ack_success(logger: logging.Logger, operation: str, **context: Any) -> None:
|
|
10
|
+
"""Log a successful SDK operation (debug only)."""
|
|
11
|
+
if context:
|
|
12
|
+
logger.debug("ack success %s %r", operation, context)
|
|
13
|
+
else:
|
|
14
|
+
logger.debug("ack success %s", operation)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def ack_failure(logger: logging.Logger, operation: str, reason: str, **context: Any) -> None:
|
|
18
|
+
"""Log a failed or skipped SDK operation (debug only)."""
|
|
19
|
+
if context:
|
|
20
|
+
logger.debug("ack failure %s reason=%s %r", operation, reason, context)
|
|
21
|
+
else:
|
|
22
|
+
logger.debug("ack failure %s reason=%s", operation, reason)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing import TYPE_CHECKING, Any, List, Optional
|
|
5
|
+
|
|
6
|
+
from acceldata.models.api.pipeline.span import Span
|
|
7
|
+
from acceldata.utils.datetime_utils import DateTimeFormatter
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from acceldata.services.pipeline_service import PipelineService
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def normalize_span_event_created_at(created_at: Optional[datetime]) -> Optional[datetime]:
|
|
15
|
+
"""Validate and normalize explicit event time (ISO-style strings + parse for API models)."""
|
|
16
|
+
raw = DateTimeFormatter.format_datetime(created_at)
|
|
17
|
+
if raw is None:
|
|
18
|
+
return None
|
|
19
|
+
return datetime.fromisoformat(raw.replace("Z", "+00:00"))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def span_create_payload(
|
|
23
|
+
*,
|
|
24
|
+
pipeline_run_id: int,
|
|
25
|
+
uid: str,
|
|
26
|
+
associated_job_uids: List[str],
|
|
27
|
+
parent_span_id: Optional[int] = None,
|
|
28
|
+
created_at: Optional[datetime] = None,
|
|
29
|
+
updated_at: Optional[datetime] = None,
|
|
30
|
+
) -> dict[str, Any]:
|
|
31
|
+
"""JSON body for ``POST .../pipelineRuns/{id}/spans`` (control-plane contract).
|
|
32
|
+
|
|
33
|
+
Optional ``created_at`` / ``updated_at`` are sent as ``createdAt`` / ``updatedAt`` (ISO-8601
|
|
34
|
+
strings) for explicit-time flows, matching :meth:`Pipeline.create_span` from the earlier SDK.
|
|
35
|
+
"""
|
|
36
|
+
span_obj: dict[str, Any] = {
|
|
37
|
+
"uid": uid,
|
|
38
|
+
"pipelineRunId": pipeline_run_id,
|
|
39
|
+
"status": "INITIALIZED",
|
|
40
|
+
}
|
|
41
|
+
if parent_span_id is not None:
|
|
42
|
+
span_obj["parentSpanId"] = parent_span_id
|
|
43
|
+
if created_at is not None:
|
|
44
|
+
span_obj["createdAt"] = created_at.isoformat()
|
|
45
|
+
if updated_at is not None:
|
|
46
|
+
span_obj["updatedAt"] = updated_at.isoformat()
|
|
47
|
+
return {"span": span_obj, "associatedJobUids": associated_job_uids}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def ensure_span_for_job(
|
|
51
|
+
service: PipelineService,
|
|
52
|
+
*,
|
|
53
|
+
pipeline_run_id: int,
|
|
54
|
+
span_uid: str,
|
|
55
|
+
job_uid: str,
|
|
56
|
+
created_at: Optional[datetime] = None,
|
|
57
|
+
updated_at: Optional[datetime] = None,
|
|
58
|
+
) -> Span:
|
|
59
|
+
"""
|
|
60
|
+
When ``bounded_by_span`` is True: create a span for the job.
|
|
61
|
+
|
|
62
|
+
Guarantee a root span exists for the run, then create a child span under that root and
|
|
63
|
+
associate the job to the child span.
|
|
64
|
+
"""
|
|
65
|
+
root_span_resource = service.get_root_span(pipeline_run_id)
|
|
66
|
+
associated: List[str] = [job_uid]
|
|
67
|
+
|
|
68
|
+
if root_span_resource is None:
|
|
69
|
+
# Root span UID is internal and deterministic for a run; job association happens on child.
|
|
70
|
+
root_span_resource = service.create_span(
|
|
71
|
+
pipeline_run_id,
|
|
72
|
+
span_create_payload(
|
|
73
|
+
pipeline_run_id=pipeline_run_id,
|
|
74
|
+
uid=f"pipeline-run-{pipeline_run_id}-root",
|
|
75
|
+
associated_job_uids=[],
|
|
76
|
+
created_at=created_at,
|
|
77
|
+
updated_at=updated_at,
|
|
78
|
+
),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
root_span_id = getattr(root_span_resource, "id", None)
|
|
82
|
+
if root_span_id is None:
|
|
83
|
+
raise ValueError("Root span has no numeric id; cannot create child span")
|
|
84
|
+
|
|
85
|
+
return service.create_span(
|
|
86
|
+
pipeline_run_id,
|
|
87
|
+
span_create_payload(
|
|
88
|
+
pipeline_run_id=pipeline_run_id,
|
|
89
|
+
uid=span_uid,
|
|
90
|
+
associated_job_uids=associated,
|
|
91
|
+
parent_span_id=int(root_span_id),
|
|
92
|
+
created_at=created_at,
|
|
93
|
+
updated_at=updated_at,
|
|
94
|
+
),
|
|
95
|
+
)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from datetime import datetime, timedelta
|
|
4
|
+
|
|
5
|
+
from acceldata.models.sdk.catalog.policy_filter import ExecutionPeriod, PolicyFilter
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TimeRangeCalculator:
|
|
9
|
+
"""Compute ``startedAfter`` / ``finishedBefore`` ranges for :class:`PolicyFilter`."""
|
|
10
|
+
|
|
11
|
+
@staticmethod
|
|
12
|
+
def check_int(input_str: str) -> bool:
|
|
13
|
+
try:
|
|
14
|
+
int(input_str)
|
|
15
|
+
return True
|
|
16
|
+
except ValueError:
|
|
17
|
+
return False
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
def calculate_minutes_before_time(minutes: int) -> tuple[datetime, datetime]:
|
|
21
|
+
finished_before_time = datetime.now()
|
|
22
|
+
started_after_time = finished_before_time - timedelta(minutes=minutes)
|
|
23
|
+
return started_after_time, finished_before_time
|
|
24
|
+
|
|
25
|
+
@staticmethod
|
|
26
|
+
def calculate_hours_before_time(hours: int) -> tuple[datetime, datetime]:
|
|
27
|
+
finished_before_time = datetime.now()
|
|
28
|
+
started_after_time = finished_before_time - timedelta(hours=hours)
|
|
29
|
+
return started_after_time, finished_before_time
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def calculate_days_before_time(days: int) -> tuple[datetime, datetime]:
|
|
33
|
+
now = datetime.now()
|
|
34
|
+
min_time = datetime.min.time()
|
|
35
|
+
started_after_time = datetime.combine((now - timedelta(days=days)).date(), min_time)
|
|
36
|
+
finished_before_time = datetime.combine(now.date(), min_time)
|
|
37
|
+
return started_after_time, finished_before_time
|
|
38
|
+
|
|
39
|
+
@staticmethod
|
|
40
|
+
def calculate_months_before_time(months_before: int) -> tuple[datetime, datetime]:
|
|
41
|
+
now = datetime.now()
|
|
42
|
+
finished_before_time = datetime(now.year, now.month, 1)
|
|
43
|
+
y, m = now.year, now.month
|
|
44
|
+
m -= months_before
|
|
45
|
+
while m <= 0:
|
|
46
|
+
m += 12
|
|
47
|
+
y -= 1
|
|
48
|
+
started_after_time = datetime(y, m, 1)
|
|
49
|
+
return started_after_time, finished_before_time
|
|
50
|
+
|
|
51
|
+
@staticmethod
|
|
52
|
+
def calculate_time_range(policy_filter: PolicyFilter) -> tuple[datetime, datetime | None]:
|
|
53
|
+
if policy_filter.period is None:
|
|
54
|
+
raise ValueError("policy_filter.period is required for time range calculation")
|
|
55
|
+
|
|
56
|
+
now = datetime.now()
|
|
57
|
+
finished_before_time = now
|
|
58
|
+
started_after_time: datetime | None = None
|
|
59
|
+
|
|
60
|
+
period = policy_filter.period
|
|
61
|
+
if period == ExecutionPeriod.Last15minutes:
|
|
62
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_minutes_before_time(15)
|
|
63
|
+
elif period == ExecutionPeriod.Last30minutes:
|
|
64
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_minutes_before_time(30)
|
|
65
|
+
elif period == ExecutionPeriod.Last1hour:
|
|
66
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_hours_before_time(1)
|
|
67
|
+
elif period == ExecutionPeriod.Last3hours:
|
|
68
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_hours_before_time(3)
|
|
69
|
+
elif period == ExecutionPeriod.Last6hours:
|
|
70
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_hours_before_time(6)
|
|
71
|
+
elif period == ExecutionPeriod.Last12hours:
|
|
72
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_hours_before_time(12)
|
|
73
|
+
elif period == ExecutionPeriod.Last24hours:
|
|
74
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_hours_before_time(24)
|
|
75
|
+
elif period == ExecutionPeriod.Today:
|
|
76
|
+
started_after_time = datetime.combine(datetime.now().date(), datetime.min.time())
|
|
77
|
+
elif period == ExecutionPeriod.Yesterday:
|
|
78
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_days_before_time(1)
|
|
79
|
+
elif period == ExecutionPeriod.Last7days:
|
|
80
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_days_before_time(7)
|
|
81
|
+
elif period == ExecutionPeriod.Thismonth:
|
|
82
|
+
started_after_time = datetime(now.year, now.month, 1)
|
|
83
|
+
elif period == ExecutionPeriod.Last1month:
|
|
84
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_months_before_time(1)
|
|
85
|
+
elif period == ExecutionPeriod.Last3month:
|
|
86
|
+
started_after_time, finished_before_time = TimeRangeCalculator.calculate_months_before_time(3)
|
|
87
|
+
else:
|
|
88
|
+
raise ValueError(f"Unsupported ExecutionPeriod: {period!r}")
|
|
89
|
+
|
|
90
|
+
return finished_before_time, started_after_time
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: acceldata_sdk_python
|
|
3
|
+
Version: 26.7.0
|
|
4
|
+
Summary: Acceldata SDK Python
|
|
5
|
+
Author-email: acceldata <apisupport@acceldata.io>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: acceldata-sdk-python
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: pydantic>=2
|
|
16
|
+
Requires-Dist: requests
|
|
17
|
+
Requires-Dist: requests-toolbelt
|
|
18
|
+
Requires-Dist: semantic-version
|
|
19
|
+
Provides-Extra: release
|
|
20
|
+
Requires-Dist: build>=1; extra == "release"
|
|
21
|
+
Requires-Dist: twine>=5; extra == "release"
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# Acceldata SDK for Python
|
|
25
|
+
|
|
26
|
+
Documentation: https://docs.acceldata.io/documentation/acceldata-sdk-python
|