Skip to content

feat: expose Data Designer run config#203

Merged
lipikaramaswamy merged 5 commits into
mainfrom
lipikaramaswamy/feature/data-designer-run-config
Jul 13, 2026
Merged

feat: expose Data Designer run config#203
lipikaramaswamy merged 5 commits into
mainfrom
lipikaramaswamy/feature/data-designer-run-config

Conversation

@lipikaramaswamy

@lipikaramaswamy lipikaramaswamy commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an optional data_designer_run_config parameter to Anonymizer(...) so callers can configure Data Designer runtime controls such as buffer_size and max_in_flight_tasks while still using Anonymizer's normal model config/provider loading path.

The name is intentionally explicit: it sits next to the existing advanced data_designer constructor parameter and avoids overloading run_config, which could be confused with AnonymizerConfig or anonymizer.run(config=...).

This keeps execution/backpressure tuning on the runtime constructor instead of putting it on AnonymizerConfig, which remains focused on anonymization behavior. The PR also re-exports RunConfig from anonymizer so examples can use the public Anonymizer import path.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring

Testing

  • make test passes locally
  • make check passes locally (format + lint + typecheck + lock-check)
  • Added/updated tests for changes

Targeted validation run:

  • uv run pytest tests/interface/test_anonymizer_interface.py -q
  • uv run ruff check src/anonymizer/interface/anonymizer.py tests/interface/test_anonymizer_interface.py

Documentation

  • If docs changed: make docs-build passes locally

No docs changed. This small API hook is intended to support self-hosted Data Designer runtime/backpressure configuration without bypassing Anonymizer's provider setup.

Related Issues

@lipikaramaswamy lipikaramaswamy force-pushed the lipikaramaswamy/feature/data-designer-run-config branch from 04ded89 to b73f6d6 Compare July 2, 2026 00:45
@lipikaramaswamy lipikaramaswamy marked this pull request as ready for review July 7, 2026 03:13
@lipikaramaswamy lipikaramaswamy requested a review from a team as a code owner July 7, 2026 03:13
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR exposes Data Designer's runtime execution controls (buffer_size, max_in_flight_tasks) through a new optional data_designer_run_config: RunConfig | None parameter on Anonymizer.__init__. RunConfig is also re-exported from the top-level anonymizer package so callers can import it from a single public path.

  • src/anonymizer/interface/anonymizer.py: Adds data_designer_run_config parameter; calls self._data_designer.set_run_config(...) after the DataDesigner instance is created/assigned and before adapters are wired up, which is the correct ordering.
  • src/anonymizer/__init__.py: Re-exports RunConfig as a first-class public symbol alongside ModelProvider.
  • tests/interface/test_anonymizer_interface.py: Adds two focused unit tests — one for the Anonymizer-managed DataDesigner path and one for the caller-supplied DataDesigner path — using Mock(spec=DataDesigner) to exercise both branches.

Confidence Score: 5/5

Safe to merge — the change is a small additive parameter with no impact on existing call sites.

The new parameter is optional and defaults to None, so all existing Anonymizer(...) call sites are completely unaffected. The set_run_config call is placed after DataDesigner construction and before adapter wiring, which is the correct ordering. Both code paths (managed and caller-supplied DataDesigner) are exercised by dedicated unit tests. The RunConfig re-export keeps the annotation runtime-resolvable, which was carefully verified in the prior review thread.

No files require special attention.

Important Files Changed

Filename Overview
src/anonymizer/interface/anonymizer.py Adds data_designer_run_config parameter; applies it to the DataDesigner instance in the correct order (after construction, before adapter wiring). No logic regressions found.
src/anonymizer/init.py Re-exports RunConfig from data_designer.config.run_config eagerly, keeping it runtime-resolvable for typing.get_type_hints() — correct given from future import annotations is in anonymizer.py.
tests/interface/test_anonymizer_interface.py Two new tests cover both the managed and caller-supplied DataDesigner paths; uses spec=DataDesigner to catch missing method errors at mock time.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Caller
    participant Anonymizer
    participant DataDesigner

    Caller->>Anonymizer: "__init__(data_designer_run_config=RunConfig(...))"

    alt data_designer is None (managed)
        Anonymizer->>DataDesigner: DataDesigner(artifact_path, model_providers)
        DataDesigner-->>Anonymizer: instance
    else data_designer supplied by caller
        Caller->>Anonymizer: "data_designer=existing instance"
    end

    alt data_designer_run_config is not None
        Anonymizer->>DataDesigner: set_run_config(run_config)
    end

    Anonymizer->>Anonymizer: NddAdapter(data_designer)
    Anonymizer->>Anonymizer: wire detection/replace/rewrite workflows
    Anonymizer-->>Caller: Anonymizer instance ready
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Caller
    participant Anonymizer
    participant DataDesigner

    Caller->>Anonymizer: "__init__(data_designer_run_config=RunConfig(...))"

    alt data_designer is None (managed)
        Anonymizer->>DataDesigner: DataDesigner(artifact_path, model_providers)
        DataDesigner-->>Anonymizer: instance
    else data_designer supplied by caller
        Caller->>Anonymizer: "data_designer=existing instance"
    end

    alt data_designer_run_config is not None
        Anonymizer->>DataDesigner: set_run_config(run_config)
    end

    Anonymizer->>Anonymizer: NddAdapter(data_designer)
    Anonymizer->>Anonymizer: wire detection/replace/rewrite workflows
    Anonymizer-->>Caller: Anonymizer instance ready
Loading

Reviews (5): Last reviewed commit: "test: remove run config type hint assert..." | Re-trigger Greptile

Comment thread src/anonymizer/interface/anonymizer.py
Signed-off-by: lipikaramaswamy <lramaswamy@nvidia.com>
Signed-off-by: lipikaramaswamy <lramaswamy@nvidia.com>

@asteier2026 asteier2026 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Signed-off-by: Lipika Ramaswamy <lipika.ramaswamy@gmail.com>
Signed-off-by: Lipika Ramaswamy <lipika.ramaswamy@gmail.com>
@lipikaramaswamy lipikaramaswamy merged commit 53dccaf into main Jul 13, 2026
14 checks passed
@lipikaramaswamy lipikaramaswamy deleted the lipikaramaswamy/feature/data-designer-run-config branch July 13, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants