Skip to content

pipelines: replace stderr prints with warnings.warn in library functions #31

@shaypal5

Description

@shaypal5

Context

PR #30 moved pipeline functions from scripts/build_v5_snapshot.py into leadforge/pipelines/build_v5.py. These functions (subsample() in particular) print warnings directly to sys.stderr.

Now that they live in the package, downstream callers can't easily suppress or redirect this output. Library code should use warnings.warn() or a logger instead.

What to do

  1. Replace print(..., file=sys.stderr) calls in leadforge/pipelines/build_v5.py with warnings.warn(..., stacklevel=2)
  2. Update tests in tests/scripts/test_build_v5_snapshot.py to use pytest.warns() instead of capsys.readouterr()
  3. Optionally keep the print in the CLI wrapper (scripts/build_v5_snapshot.py) for user-facing progress messages

Origin

Copilot review comment on PR #30.

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer: pipelinespipelines/ — dataset build transformationstype: refactorCode change with no behavior difference

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions