OpenMetadata/docs
Eugenio 782a87a706
refactor(sampler): collapse SamplerInterface to a single typed config object (#28147)
* refactor(sampler): collapse SamplerInterface to a single config object

Replace the 9-parameter constructor/create() signature with a typed
SamplerConfig hierarchy (SamplerConfig / DatabaseSamplerConfig /
StorageSamplerConfig). Config resolution — partition_details,
sample_query, include/exclude columns, sample_config, sample_data_count
— now happens in callers (entity_adapters, profiler_source,
base_test_suite_source) before construction, so the interface only
receives already-resolved values.

- Add sampler_config.py with SamplerConfig dataclass hierarchy
- Remove database-specific imports from SamplerInterface base class
- Move SSL connection setup and column include/exclude filtering to
  database-family subclasses (SQASampler, PandasSampler, NoSQLSampler)
- Simplify BigQuery/Postgres/Snowflake samplers to *args/**kwargs init
- Remove StorageSampler.create() override; base create() is sufficient
- Update profiler_source and base_test_suite_source to build
  DatabaseSamplerConfig before calling sampler_class.create()

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

* docs(sampler): fix build_sampler_kwargs example to use SamplerConfig

The non-database adapter example was showing the old flat kwargs pattern
(sample_config, sample_data_count) that SamplerInterface now silently
ignores via **__. Replace with the correct "config": SamplerConfig(...)
pattern that matches the actual ContainerAdapter implementation.

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

* fix(sampler): guard BigQuerySampler.tableType access with isinstance check

ClassifiableEntityType includes Container which has no tableType.
The *args/**kwargs init simplified the constructor but lost the
explicit Table type annotation, triggering a basedpyright error.
Guard with isinstance(self.entity, Table) so the type checker
knows tableType is only accessed on Table entities.

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

* Fix tests

* Gitar bot feedback

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 14:56:02 +02:00
..
auto-classification refactor(sampler): collapse SamplerInterface to a single typed config object (#28147) 2026-05-19 14:56:02 +02:00
plans Feature/search indexing issues (#25594) 2026-01-29 18:50:39 +05:30
csv-relation-types-plan.md Glossary relations (#25886) 2026-03-18 10:51:03 +05:30
impersonation-design.md Add RDF local dev (#24825) 2025-12-15 10:49:13 +01:00
rdf-local-development.md RDF, cleanup relations and remove unnecessary bindings, add distributed mode for RDF reindex (#26902) 2026-04-14 13:24:41 -07:00
streamable-logs.md fix(log-storage): plug clobber bugs in streamable S3 logs (partial.txt + logs.txt) (#27926) 2026-05-15 11:02:19 +02:00