For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Getting Started
    • Welcome
    • Contributing
  • Concepts
    • Columns
    • Seed Datasets
    • Agent Rollout Ingestion
    • Custom Columns
    • Validators
    • Processors
    • Person Sampling
    • Traces
    • Architecture & Performance
    • Deployment Options
    • Security
  • Tutorials
    • Overview
    • The Basics
    • Structured Outputs, Jinja Expressions, and Conditional Generation
    • Seeding with an External Dataset
    • Providing Images as Context
    • Generating Images
    • Image-to-Image Editing
  • Recipes
    • Recipe Cards
  • Plugins
    • Overview
    • Example Plugin
    • FileSystemSeedReader Plugins
    • Discover
  • Code Reference
    • Overview
      • Overview
      • models
      • mcp
      • column_configs
      • config_builder
      • data_designer_config
      • run_config
      • sampler_params
      • validator_params
      • seeds
      • processors
      • analysis
      • Config API
        • Analysis
        • Base
        • Column Configs
        • Column Types
        • Config Builder
        • Custom Column
        • Data Designer Config
        • Dataset Metadata
        • Default Model Settings
        • Errors
        • Exportable Config
        • Fingerprint
        • Interface
        • Mcp
        • Models
        • Preview Results
        • Processor Types
        • Processors
        • Run Config
        • Sampler Constraints
        • Sampler Params
        • Seed
        • Seed Source
        • Seed Source Dataframe
        • Seed Source Types
        • Testing
        • Utils
          • Code Lang
          • Constants
          • Errors
          • Image Helpers
          • Info
          • Io Helpers
          • Misc
          • Numerical Helpers
          • Trace Renderer
          • Trace Type
          • Type Helpers
          • Visualization
          • Warning Helpers
        • Validator Params
        • Version
  • Dev Notes
    • Overview
    • Have It Your Way
    • VLM Long Document Understanding
    • Push Datasets to Hugging Face Hub
    • Text-to-SQL for Nemotron Super
    • Async All the Way Down
    • Owning the Model Stack
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogoNeMo Data Designer
On this page
  • Module Contents
  • Functions
  • Data
  • API
Code ReferenceConfigConfig APIUtils

data_designer.config.utils.warning_helpers

||View as Markdown|
Previous

Visualization

Next

Validator Params

Helpers for emitting warnings that attribute correctly to user code.

Library-internal warnings (typically emitted from a pydantic @model_validator or from a helper function) need to be attributed to the user’s call site, not to the library frame that happened to fire them. Two reasons:

  1. Attribution — a source location pointing at library internals isn’t actionable.

  2. Visibility under default filters — Python’s default DeprecationWarning filter is::

    default::DeprecationWarning:main ignore::DeprecationWarning

    Library-attributed DeprecationWarning entries fall under the second filter and are silenced. Attributing to user code is what gets the warning actually shown.

  3. Deduplication — Python’s once-per-location dedup key is (category, module, lineno). When every call resolves to the same library-internal line, every warning after the first is silently suppressed regardless of which user file triggered it.

warn_at_caller walks the stack past frames whose module belongs to a known internal package (pydantic, data_designer) and uses warnings.warn_explicit to attribute the warning at the first user frame.

Module Contents

Functions

NameDescription
_module_in_prefixesReturn True if module_name belongs to one of the prefix-rooted packages.
warn_at_callerEmit message attributed to the first frame outside skip_prefixes.

Data

DEFAULT_INTERNAL_PREFIXES

API

DEFAULT_INTERNAL_PREFIXES
tuple[str, ...]Defaults to ('pydantic', 'pydantic_core', 'data_designer')

Modules whose frames are skipped when walking up to the user’s call site.

Matching is exact-or-dotted-prefix (see _module_in_prefixes), so pydantic_helpers is not treated as part of pydantic.

1data_designer.config.utils.warning_helpers._module_in_prefixes(
2 module_name: str,
3 prefixes: tuple[str, ...]
4) -> bool

Return True if module_name belongs to one of the prefix-rooted packages.

Uses exact-equality plus dotted-prefix matching so that, e.g., pydantic_helpers is NOT treated as part of the pydantic package while pydantic.fields is. Same for data_designer vs. a hypothetical data_designer_other.

1data_designer.config.utils.warning_helpers.warn_at_caller(
2 message: str,
3 category: type[Warning],
4 *,
5 skip_prefixes: tuple[str, ...] = DEFAULT_INTERNAL_PREFIXES
6) -> None

Emit message attributed to the first frame outside skip_prefixes.

Intended for warnings whose root cause is the user’s call site but whose emission point is library code (a pydantic validator, an internal helper, etc.). The walk starts above this helper’s own frame and skips every frame whose module belongs to a package in skip_prefixes until it reaches a user frame.

The default skip set covers:

  • pydantic / pydantic_core — so warnings emitted from @model_validator callbacks escape pydantic’s dispatch frames.
  • data_designer — so warnings emitted from a registry / model-config built deep inside a DataDesigner helper still attribute to the outermost user call. Without this, attribution lands on a library file and Python’s default DeprecationWarning filter silences the warning entirely.

The user frame’s __warningregistry__ is passed to warnings.warn_explicit so Python’s built-in once-per-location dedup keys on the user’s (filename, lineno) rather than an internal frame.

We deliberately do not pass module_globals — it’s only used for linecache source-line display, and for scripts run with python -c (where the user frame’s __loader__ is BuiltinImporter for __main__) the lookup raises ImportError("'__main__' is not a built-in module"). Skipping module_globals keeps the warning path robust at the cost of an empty source line in the formatted output.