Summary
When using a Python config module (.py file) with data-designer create or data-designer preview, there is currently no way to pass custom arguments to the user's load_config_builder() function. This limits the flexibility of custom config scripts — users must hardcode values or manage their own env-var-based workarounds.
Proposed behavior
Allow users to pass extra arguments after a -- separator, which get forwarded to the Python module's load_config_builder() function:
data-designer create ./my_custom.py --num-records 32 -- --key value --key2 value2
data-designer preview ./my_custom.py -n 10 -- --model large --temperature 0.7
Everything after -- would be captured and passed to load_config_builder as a context object (e.g. a list[str] or a lightweight wrapper). The user's function signature would then optionally accept this:
# Before (still works, no args)
def load_config_builder() -> DataDesignerConfigBuilder:
...
# After (opt-in to receive CLI args)
def load_config_builder(cli_args: list[str] | None = None) -> DataDesignerConfigBuilder:
builder = DataDesignerConfigBuilder()
if cli_args:
# User parses as they see fit (argparse, simple iteration, etc.)
...
return builder
Changes required
- CLI commands (
create, preview, validate): Accept and capture arguments after -- via Typer's context.args or Click's allow_extra_args mechanism.
load_config_builder() in config_loader.py: Accept an optional cli_args: list[str] | None = None parameter and pass it through to _load_from_python_module.
_load_from_python_module(): Inspect the user's load_config_builder signature. If it accepts a parameter (via inspect.signature), pass cli_args; otherwise call with no arguments for backwards compatibility.
GenerationController._load_config(): Thread the extra args from the command through to load_config_builder().
Why
Custom Python config modules are a key extensibility surface. Users frequently want to parameterize their configs — e.g. switching model endpoints, adjusting generation parameters, or toggling column sets — without maintaining separate config files for each variant. Passthrough CLI args are the standard Unix pattern for this and would make the Python module path significantly more useful.
Backwards compatibility
- YAML/JSON configs: unaffected (extra args after
-- are simply ignored or produce a clear error).
- Existing Python modules with
def load_config_builder(): (no params): continue to work as-is via signature inspection.
- Only Python modules that opt in by adding a
cli_args parameter will receive the extra arguments.
Summary
When using a Python config module (
.pyfile) withdata-designer createordata-designer preview, there is currently no way to pass custom arguments to the user'sload_config_builder()function. This limits the flexibility of custom config scripts — users must hardcode values or manage their own env-var-based workarounds.Proposed behavior
Allow users to pass extra arguments after a
--separator, which get forwarded to the Python module'sload_config_builder()function:Everything after
--would be captured and passed toload_config_builderas a context object (e.g. alist[str]or a lightweight wrapper). The user's function signature would then optionally accept this:Changes required
create,preview,validate): Accept and capture arguments after--via Typer'scontext.argsor Click'sallow_extra_argsmechanism.load_config_builder()inconfig_loader.py: Accept an optionalcli_args: list[str] | None = Noneparameter and pass it through to_load_from_python_module._load_from_python_module(): Inspect the user'sload_config_buildersignature. If it accepts a parameter (viainspect.signature), passcli_args; otherwise call with no arguments for backwards compatibility.GenerationController._load_config(): Thread the extra args from the command through toload_config_builder().Why
Custom Python config modules are a key extensibility surface. Users frequently want to parameterize their configs — e.g. switching model endpoints, adjusting generation parameters, or toggling column sets — without maintaining separate config files for each variant. Passthrough CLI args are the standard Unix pattern for this and would make the Python module path significantly more useful.
Backwards compatibility
--are simply ignored or produce a clear error).def load_config_builder():(no params): continue to work as-is via signature inspection.cli_argsparameter will receive the extra arguments.