OpenMetadata/docs/auto-classification
Eugenio 56bda498b5
Refactor(ingestion): introduce ClassifiableEntityAdapter to eliminate scattered isinstance checks (#27716)
* refactor(sampler): introduce EntityAdapter to centralise per-entity classification logic

Replace scattered isinstance(entity, Table/Container) branches across
processor.py, pii/base_processor.py, patch_mixin.py, and metadata_rest.py
with a single EntityAdapter strategy pattern in sampler/entity_adapters.py.

Each adapter encodes get_columns, set_columns, patch_fields,
build_sampler_kwargs, pipeline_config_class, and service_type for one entity
type. _BY_ENTITY and _BY_PIPELINE registries make lookup O(1). Adding a new
classifiable entity now requires changes to entity_adapters.py only — no
other ingestion files need to change.

Also extracts build_database_service_conn_config into sampler/config_utils.py
and updates the developer guide accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Apply PR feedback

* Typing and text fixes

* Apply gitar bot feedback

* Fix tests

* Apply Gitar bot suggestions

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 09:37:58 +02:00
..
add-support-for-another-entity.md Refactor(ingestion): introduce ClassifiableEntityAdapter to eliminate scattered isinstance checks (#27716) 2026-05-13 09:37:58 +02:00