项目文件夹

文件
wehub-resource-sync bf2343b7e4
Integration Tests - MySQL + Elasticsearch / Detect Changes (push) Has been cancelled
Integration Tests - MySQL + Elasticsearch / integration-tests-mysql-elasticsearch (push) Has been cancelled
Integration Tests - PostgreSQL + Elasticsearch + Redis / Detect Changes (push) Has been cancelled
Integration Tests - PostgreSQL + Elasticsearch + Redis / integration-tests-postgres-elasticsearch-redis (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / Detect Changes (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / integration-tests-postgres-opensearch (push) Has been cancelled
Java Checkstyle / java-checkstyle (push) Has been cancelled
Maven Collate Tests / maven-collate-ci (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests-status (push) Has been cancelled
Publish Package to Maven Central Repository / publish-maven-packages (push) Has been cancelled
OpenMetadata Service Unit Tests / Detect Changes (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests (push) Has been cancelled
OpenMetadata Service Unit Tests / k8s_operator-unit-tests (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:35:45 +08:00

2.1 KiB

ServiceSpec Standards

What ServiceSpec Does

The ServiceSpec tells the framework how to load a connector. It maps capabilities to their implementing classes.

The framework resolves it at: metadata.ingestion.source.{service_type}.{name}.service_spec.ServiceSpec

Database Connectors

Use DefaultDatabaseSpec, which pre-wires profiler, sampler, and test suite:

from metadata.ingestion.source.database.my_db.connection import MyDbConnectionObj
from metadata.ingestion.source.database.my_db.lineage import MyDbLineageSource
from metadata.ingestion.source.database.my_db.metadata import MyDbSource
from metadata.ingestion.source.database.my_db.usage import MyDbUsageSource
from metadata.utils.service_spec.default import DefaultDatabaseSpec

ServiceSpec = DefaultDatabaseSpec(
    metadata_source_class=MyDbSource,
    lineage_source_class=MyDbLineageSource,     # Only if lineage capability
    usage_source_class=MyDbUsageSource,          # Only if usage capability
    connection_class=MyDbConnectionObj,          # Only for SQLAlchemy connectors
)

DefaultDatabaseSpec automatically provides:

  • profiler_classSQAProfilerInterface
  • sampler_classSQASampler
  • test_suite_classSQATestSuiteInterface
  • data_diffBaseTableParameter

Non-SQLAlchemy Database

For REST/SDK database connectors (e.g., Salesforce), omit connection_class:

ServiceSpec = DefaultDatabaseSpec(
    metadata_source_class=MyRestDbSource,
)

Non-Database Connectors

Use BaseSpec with only the metadata source class:

from metadata.ingestion.source.dashboard.my_dash.metadata import MyDashSource
from metadata.utils.service_spec import BaseSpec

ServiceSpec = BaseSpec(metadata_source_class=MyDashSource)

This applies to: dashboard, pipeline, messaging, mlmodel, storage, search, api.

Rules

  1. The variable MUST be named ServiceSpec (exact casing)
  2. The module MUST be named service_spec.py
  3. Import paths must use the full module path
  4. Do not add extra capabilities that the connector doesn't support
  5. connection_class is only for BaseConnection subclasses (SQLAlchemy pattern)