open-metadata--openmetadata
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
2.1 KiB
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_class→SQAProfilerInterfacesampler_class→SQASamplertest_suite_class→SQATestSuiteInterfacedata_diff→BaseTableParameter
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
- The variable MUST be named
ServiceSpec(exact casing) - The module MUST be named
service_spec.py - Import paths must use the full module path
- Do not add extra capabilities that the connector doesn't support
connection_classis only forBaseConnectionsubclasses (SQLAlchemy pattern)