DataDesigner/packages/data-designer-engine/tests/engine/column_generators
Andre Manoel 8fff7c07fe
feat: add async generator migration with symmetric bridging and statefulness (#378)
* feat: add async generator migration with symmetric bridging and statefulness

- Symmetric generate/agenerate bridging in base ColumnGenerator
- is_stateful property; SeedDatasetColumnGenerator declares True
- Async wrappers for FromScratchColumnGenerator and ColumnGeneratorFullColumn
- Native async paths for ImageCellGenerator and EmbeddingCellGenerator
- CustomColumnGenerator.agenerate with full validation parity
- Extract _postprocess_result for shared sync/async output validation

* fix: avoid blocking caller on sync bridge timeout

Use explicit pool lifecycle instead of context manager so that
a TimeoutError releases the caller immediately via
shutdown(wait=False) rather than blocking on pool.__exit__.

* fix: widen agenerate type signature to match generate

Add @overload declarations so the base agenerate accepts both
dict and pd.DataFrame, mirroring the existing generate pattern.

* fix: ensure pool shutdown on sync bridge success path

The else clause after return was unreachable, leaking the
ThreadPoolExecutor on every successful call. Capture the result
first, shut down the pool, then return.

* fix: use try/finally for pool shutdown in sync bridge

Ensures ThreadPoolExecutor is shut down on all exit paths,
including non-TimeoutError exceptions from the coroutine.

* refactor: extract shared validation in ImageCellGenerator

Move duplicated input validation and prompt rendering into
_prepare_image_inputs, shared by generate and agenerate.

* refactor: extract shared input prep in EmbeddingCellGenerator

* address PR review feedback

- add _is_overridden helper for symmetric generate/agenerate guards
- move defensive .copy() into base agenerate, remove subclass overrides
- re-raise as builtin TimeoutError for Python 3.10 compat
- rename is_stateful to is_order_dependent with improved docstring
- replace brittle .fget test with object.__new__
- add async tests for ImageCellGenerator and EmbeddingCellGenerator
2026-03-11 14:20:09 -03:00
..
generators feat: add async generator migration with symmetric bridging and statefulness (#378) 2026-03-11 14:20:09 -03:00
utils feat: add image generation support with multi-modal context (#317) 2026-02-12 14:00:28 -07:00
test_registry.py chore: add publish script and update license headers (#253) 2026-01-28 08:47:34 -05:00